muffin_man 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 452a879ba32d96175ec80f2ec96c23d8b52fdb02825e9a27d1b90048f34bfc07
4
- data.tar.gz: dba288535b7f032c084cdcfeb9f8d40ca5ad5d60152f0efde44cc2659a760252
3
+ metadata.gz: c253f9126fb48ecbbe228b42323456c6ddaa88bbb6677f0bedf2bcdfbc432a36
4
+ data.tar.gz: 10c960af76cf5f319552791d64e65591f96018d94849fc36a48fe4daa9ee37f2
5
5
  SHA512:
6
- metadata.gz: 3f19c0be669410e54f1578ca18a5b9c23a9ae178b9b15c9314224e8c79b1b8ed0344a3cccde5c196e4f12d7678aa455c9ebdadcd306680c779fb05e2ad822587
7
- data.tar.gz: 7a6123fd6c3e90d505bc9408a3c9b5b8b3606074d0117e5bfb2de2b2b26741df970819631c77c3822903a8dba7131fdbf57d9adfaebb8eda5403e535e44057cb
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
@@ -1,8 +1,8 @@
1
1
  # MuffinMan
2
2
 
3
- ![Ruby CI](https://github.com/patterninc/muffin_man/actions/workflows/ci.yml/badge.svg)
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
 
@@ -15,7 +15,7 @@ module MuffinMan
15
15
  keywordsLocale
16
16
  locale
17
17
  ].freeze
18
- GET_CATALOG_ITEM_PARAMS = %w[includeData locale].freeze
18
+ GET_CATALOG_ITEM_PARAMS = %w[includedData locale].freeze
19
19
 
20
20
  def search_catalog_items(keywords, marketplace_ids, params = {})
21
21
  if sandbox
@@ -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
@@ -59,10 +59,7 @@ module MuffinMan
59
59
  end
60
60
 
61
61
  def request
62
- @request ||= Typhoeus::Request.new(
63
- canonical_uri,
64
- params: query_params
65
- )
62
+ Typhoeus::Request.new(canonical_uri, params: query_params)
66
63
  end
67
64
 
68
65
  def retrieve_lwa_access_token
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MuffinMan
4
- VERSION = "1.0.0"
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.0
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-01-28 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
@@ -111,7 +111,6 @@ executables: []
111
111
  extensions: []
112
112
  extra_rdoc_files: []
113
113
  files:
114
- - ".circleci/config.yml"
115
114
  - ".github/workflows/ci.yml"
116
115
  - ".gitignore"
117
116
  - ".rspec"
@@ -125,6 +124,7 @@ files:
125
124
  - bin/setup
126
125
  - lib/muffin_man.rb
127
126
  - lib/muffin_man/catalog_items/v20201201.rb
127
+ - lib/muffin_man/finances/v0.rb
128
128
  - lib/muffin_man/reports/v20210630.rb
129
129
  - lib/muffin_man/solicitations/v1.rb
130
130
  - lib/muffin_man/sp_api_client.rb
@@ -149,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  - !ruby/object:Gem::Version
150
150
  version: '0'
151
151
  requirements: []
152
- rubygems_version: 3.2.3
152
+ rubygems_version: 3.1.6
153
153
  signing_key:
154
154
  specification_version: 4
155
155
  summary: Amazon Selling Partner API client
data/.circleci/config.yml DELETED
@@ -1,13 +0,0 @@
1
- version: 2.1
2
- jobs:
3
- build:
4
- docker:
5
- - image: ruby:2.6.3
6
- steps:
7
- - checkout
8
- - run:
9
- name: Run the default task
10
- command: |
11
- gem install bundler -v 2.2.5
12
- bundle install
13
- bundle exec rake