muffin_man 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01a263a02506880dbfef45399e3294486b858cc72d5a9fc370f155128de17d0a
4
- data.tar.gz: d8fdd99a82562bcc2c354fb8c59d2c7c366802fbdf41b8b45c1f9f0ab9b596d8
3
+ metadata.gz: c253f9126fb48ecbbe228b42323456c6ddaa88bbb6677f0bedf2bcdfbc432a36
4
+ data.tar.gz: 10c960af76cf5f319552791d64e65591f96018d94849fc36a48fe4daa9ee37f2
5
5
  SHA512:
6
- metadata.gz: ad0248e2f1020a243bdb2901d7c0331d377733c01490875a64e2e92f380702fabfd34abc5aafcaf6c39244891380551d0d9e20b35197d969ed09d93ab551a06e
7
- data.tar.gz: cac4177e290055336395d095936236f48449df8f56cee789a4201c5dd6e3eb9afecae7f2923c4ec6964515eb6a492ac5bbc597f1fcd35bda0d6fab56cf392e11
6
+ metadata.gz: 377273e4a2f05f4358a4aad602490e2ba16241ca162a208560711ca933bfb06fa1e813929095e624aaf441a7c5c1e5c694e36aec472bb96e64002f5a82ff8384
7
+ data.tar.gz: 35769ae5f42ac6f69c50dc90755ecbd27b027e6b1334bf6b06b6527b42b345d1d4cbcb0cd3f5fa42166e11bf6659788dcc7f220dc67b207e4ceb8d62b2b8e845
data/CODE_OF_CONDUCT.md CHANGED
@@ -39,7 +39,7 @@ This Code of Conduct applies within all community spaces, and also applies when
39
39
 
40
40
  ## Enforcement
41
41
 
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at gavin@iserve.com. All complaints will be reviewed and investigated promptly and fairly.
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at opensource@pattern.com. All complaints will be reviewed and investigated promptly and fairly.
43
43
 
44
44
  All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
45
 
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Ruby CI](https://github.com/patterninc/muffin_man/actions/workflows/ci.yml/badge.svg)](https://github.com/patterninc/muffin_man/actions)
4
4
 
5
- MuffinMan is a ruby interface to the Amazon Selling Partner API. For more information on registering to use the Selling Partner API, see [Amazon's documentation](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md)
5
+ MuffinMan is a ruby interface to the Amazon Selling Partner API. For more information on registering to use the Selling Partner API, see [Amazon's documentation](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md)
6
6
 
7
7
  As of now, this gem only supports portions of the following APIs with more to come:
8
8
 
@@ -0,0 +1,28 @@
1
+ module MuffinMan
2
+ module Finances
3
+ class V0 < SpApiClient
4
+
5
+ def list_financial_event_groups(max_results_per_page = nil, financial_event_group_started_before = nil, financial_event_group_started_after = nil, next_token = nil)
6
+ @local_var_path = "/finances/v0/financialEventGroups"
7
+ @query_params = {}
8
+ @query_params['MaxResultsPerPage'] = max_results_per_page unless max_results_per_page.nil?
9
+ @query_params['FinancialEventGroupStartedBefore'] = financial_event_group_started_before unless financial_event_group_started_before.nil?
10
+ @query_params['FinancialEventGroupStartedAfter'] = financial_event_group_started_after unless financial_event_group_started_after.nil?
11
+ @query_params['NextToken'] = next_token unless next_token.nil?
12
+ @request_type = "GET"
13
+ call_api
14
+ end
15
+
16
+ def list_financial_events_by_group_id(event_group_id, max_results_per_page = nil, posted_after = nil, posted_before = nil, next_token = nil)
17
+ @local_var_path = "/finances/v0/financialEventGroups/#{event_group_id}/financialEvents"
18
+ @query_params = {}
19
+ @query_params['MaxResultsPerPage'] = max_results_per_page unless max_results_per_page.nil?
20
+ @query_params['PostedAfter'] = posted_after unless posted_after.nil?
21
+ @query_params['PostedBefore'] = posted_before unless posted_before.nil?
22
+ @query_params['NextToken'] = next_token unless next_token.nil?
23
+ @request_type = "GET"
24
+ call_api
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,12 +1,40 @@
1
1
  module MuffinMan
2
2
  module Reports
3
3
  class V20210630 < SpApiClient
4
- SANDBOX_REPORT_TYPE = "GET_MERCHANT_LISTINGS_ALL_DATA"
5
- SANDBOX_START_TIME = "2019-12-10T20:11:24.000Z"
6
- SANDBOX_MARKETPLACE_IDS = [
7
- "A1PA6795UKMFR9",
8
- "ATVPDKIKX0DER"
9
- ]
4
+ SANDBOX_REPORT_TYPES = "FEE_DISCOUNTS_REPORT,GET_AFN_INVENTORY_DATA".freeze
5
+ SANDBOX_PROCESSING_STATUSES = "IN_QUEUE,IN_PROGRESS".freeze
6
+ SANDBOX_REPORT_TYPE = "GET_MERCHANT_LISTINGS_ALL_DATA".freeze
7
+ SANDBOX_START_TIME = "2019-12-10T20:11:24.000Z".freeze
8
+ SANDBOX_CANCEL_REPORT_ID = "ID".freeze
9
+ SANDBOX_MARKETPLACE_IDS = %w[
10
+ A1PA6795UKMFR9
11
+ ATVPDKIKX0DER
12
+ ].freeze
13
+ SANDBOX_REPORT_ID = "ID323".freeze
14
+ SANDBOX_REPORT_DOCUMENT_ID = "0356cf79-b8b0-4226-b4b9-0ee058ea5760".freeze
15
+
16
+ GET_REPORTS_PARAMS = %w[
17
+ reportTypes
18
+ processingStatuses
19
+ marketplaceIds
20
+ pageSize
21
+ createdSince
22
+ createdUntil
23
+ nextToken
24
+ ].freeze
25
+
26
+ def get_reports(params = {})
27
+ @local_var_path = "/reports/2021-06-30/reports"
28
+ if sandbox
29
+ params = {
30
+ "reportTypes" => SANDBOX_REPORT_TYPES,
31
+ "processingStatuses" => SANDBOX_PROCESSING_STATUSES
32
+ }
33
+ end
34
+ @query_params = params.slice(*GET_REPORTS_PARAMS)
35
+ @request_type = "GET"
36
+ call_api
37
+ end
10
38
 
11
39
  def create_report(report_type, marketplace_ids, start_time = nil, end_time = nil, report_options = {})
12
40
  report_type = sandbox ? SANDBOX_REPORT_TYPE : report_type
@@ -21,7 +49,28 @@ module MuffinMan
21
49
  @request_body["dataStartTime"] = start_time unless start_time.nil?
22
50
  @request_body["dataEndTime"] = end_time unless end_time.nil?
23
51
  @request_body["reportOptions"] = report_options unless report_options.empty?
24
- @request_type = 'POST'
52
+ @request_type = "POST"
53
+ call_api
54
+ end
55
+
56
+ def get_report(report_id)
57
+ report_id = sandbox ? SANDBOX_REPORT_ID : report_id
58
+ @local_var_path = "/reports/2021-06-30/reports/#{report_id}"
59
+ @request_type = "GET"
60
+ call_api
61
+ end
62
+
63
+ def cancel_report(report_id)
64
+ report_id = sandbox ? SANDBOX_CANCEL_REPORT_ID : report_id
65
+ @local_var_path = "/reports/2021-06-30/reports/#{report_id}"
66
+ @request_type = "DELETE"
67
+ call_api
68
+ end
69
+
70
+ def get_report_document(report_document_id)
71
+ report_document_id = sandbox ? SANDBOX_REPORT_DOCUMENT_ID : report_document_id
72
+ @local_var_path = "/reports/2021-06-30/documents/#{report_document_id}"
73
+ @request_type = "GET"
25
74
  call_api
26
75
  end
27
76
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "1.0.2"
4
+ VERSION = "1.1.0"
5
5
  end
data/lib/muffin_man.rb CHANGED
@@ -3,6 +3,7 @@ require "muffin_man/sp_api_client"
3
3
  require "muffin_man/solicitations/v1"
4
4
  require "muffin_man/reports/v20210630"
5
5
  require "muffin_man/catalog_items/v20201201"
6
+ require "muffin_man/finances/v0"
6
7
 
7
8
  module MuffinMan
8
9
  class Error < StandardError; end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: muffin_man
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-02-03 00:00:00.000000000 Z
13
+ date: 2022-04-05 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec
@@ -124,6 +124,7 @@ files:
124
124
  - bin/setup
125
125
  - lib/muffin_man.rb
126
126
  - lib/muffin_man/catalog_items/v20201201.rb
127
+ - lib/muffin_man/finances/v0.rb
127
128
  - lib/muffin_man/reports/v20210630.rb
128
129
  - lib/muffin_man/solicitations/v1.rb
129
130
  - lib/muffin_man/sp_api_client.rb