Sha256: 73c2bb6b3a8bec72505bc1af232d25eea96a8f4cd3c0b13c306e955b78b81d39

Contents?: true

Size: 1.05 KB

Versions: 3

Compression:

Stored size: 1.05 KB

Contents

module MuffinMan
  module Reports
    class V20210630 < SpApiClient
      SANDBOX_REPORT_TYPE = "GET_MERCHANT_LISTINGS_ALL_DATA"
      SANDBOX_START_TIME = "2019-12-10T20:11:24.000Z"
      SANDBOX_MARKETPLACE_IDS = [
        "A1PA6795UKMFR9",
        "ATVPDKIKX0DER"
      ]

      def create_report(report_type, marketplace_ids, start_time = nil, end_time = nil, report_options = {})
        report_type = sandbox ? SANDBOX_REPORT_TYPE : report_type
        marketplace_ids = sandbox ? SANDBOX_MARKETPLACE_IDS : marketplace_ids
        start_time = sandbox ? SANDBOX_START_TIME : start_time

        @local_var_path = "/reports/2021-06-30/reports"
        @request_body = {
          "reportType" => report_type,
          "marketplaceIds" => marketplace_ids,
        }
        @request_body["dataStartTime"] = start_time unless start_time.nil?
        @request_body["dataEndTime"] = end_time unless end_time.nil?
        @request_body["reportOptions"] = report_options unless report_options.empty?
        @request_type = 'POST'
        call_api
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
muffin_man-1.0.2 lib/muffin_man/reports/v20210630.rb
muffin_man-1.0.1 lib/muffin_man/reports/v20210630.rb
muffin_man-1.0.0 lib/muffin_man/reports/v20210630.rb