jamm 0.0.1 → 1.0.1
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 +4 -4
- data/.gitignore +6 -57
- data/.rubocop.yml +18 -25
- data/Gemfile +4 -0
- data/Gemfile.lock +99 -0
- data/README.md +4 -4
- data/Rakefile +2 -0
- data/jamm.gemspec +16 -3
- data/lib/jamm/api/api/customer_api.rb +265 -0
- data/lib/jamm/api/api/healthcheck_api.rb +76 -0
- data/lib/jamm/api/api/payment_api.rb +145 -0
- data/lib/jamm/api/api_client.rb +385 -0
- data/lib/jamm/api/api_error.rb +58 -0
- data/lib/jamm/api/configuration.rb +293 -0
- data/lib/jamm/api/models/customer_service_update_customer_body.rb +247 -0
- data/lib/jamm/api/models/protobuf_any.rb +209 -0
- data/lib/jamm/api/models/rpc_status.rb +218 -0
- data/lib/jamm/api/models/v1_buyer.rb +274 -0
- data/lib/jamm/api/models/v1_charge.rb +233 -0
- data/lib/jamm/api/models/v1_contract.rb +225 -0
- data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +217 -0
- data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +222 -0
- data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +212 -0
- data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +217 -0
- data/lib/jamm/api/models/v1_create_customer_request.rb +207 -0
- data/lib/jamm/api/models/v1_create_customer_response.rb +207 -0
- data/lib/jamm/api/models/v1_customer.rb +223 -0
- data/lib/jamm/api/models/v1_delete_customer_response.rb +207 -0
- data/lib/jamm/api/models/v1_get_customer_response.rb +207 -0
- data/lib/jamm/api/models/v1_initial_charge.rb +225 -0
- data/lib/jamm/api/models/v1_merchant.rb +212 -0
- data/lib/jamm/api/models/v1_merchant_customer.rb +213 -0
- data/lib/jamm/api/models/v1_payment_link.rb +221 -0
- data/lib/jamm/api/models/v1_ping_response.rb +207 -0
- data/lib/jamm/api/models/v1_update_customer_response.rb +207 -0
- data/lib/jamm/api/models/v1_url.rb +216 -0
- data/lib/jamm/api/version.rb +15 -0
- data/lib/jamm/api.rb +64 -0
- data/lib/jamm/errors.rb +4 -14
- data/lib/jamm/oauth.rb +3 -1
- data/lib/jamm/version.rb +3 -1
- data/lib/jamm.rb +14 -127
- metadata +59 -38
- data/.github/workflows/build.yml +0 -23
- data/.github/workflows/ruby-publish.yml +0 -24
- data/CONTRIBUTORS +0 -1
- data/images/jamm_logo.png +0 -0
- data/lib/jamm/api_operations/create.rb +0 -16
- data/lib/jamm/api_operations/get.rb +0 -16
- data/lib/jamm/api_operations/list.rb +0 -16
- data/lib/jamm/api_operations/update.rb +0 -16
- data/lib/jamm/api_resource.rb +0 -5
- data/lib/jamm/charge.rb +0 -10
- data/lib/jamm/jamm_object.rb +0 -249
- data/lib/jamm/payment.rb +0 -18
- data/lib/jamm/request.rb +0 -13
- data/lib/jamm/time_util.rb +0 -41
- data/lib/jamm/token.rb +0 -10
- data/lib/jamm/util.rb +0 -76
- data/test/jamm/charge_test.rb +0 -56
- data/test/jamm/oauth_test.rb +0 -47
- data/test/jamm/payment_test.rb +0 -17
- data/test/jamm/time_util_test.rb +0 -18
- data/test/jamm/token_test.rb +0 -52
- data/test/test_data.rb +0 -118
- data/test/test_helper.rb +0 -59
data/lib/jamm/errors.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Jamm
|
2
4
|
class JammError < StandardError
|
3
5
|
attr_reader :message, :http_body, :http_headers, :http_status, :json_body
|
4
6
|
|
5
7
|
def initialize(message = nil, http_status: nil, http_headers: nil, http_body: nil, json_body: nil)
|
8
|
+
super(message)
|
9
|
+
|
6
10
|
@message = message
|
7
11
|
@http_status = http_status
|
8
12
|
@http_headers = http_headers
|
@@ -19,18 +23,4 @@ module Jamm
|
|
19
23
|
# OAuthError is raised when a request to AWS cognito failed
|
20
24
|
class OAuthError < JammError
|
21
25
|
end
|
22
|
-
|
23
|
-
# ApiConnectionError is raised when a request to Jamm api failed
|
24
|
-
class ApiConnectionError < JammError
|
25
|
-
end
|
26
|
-
|
27
|
-
# ApiError is raised when Jamm api failed with an unexpected reason
|
28
|
-
class ApiError < JammError
|
29
|
-
end
|
30
|
-
|
31
|
-
class InvalidRequestError < JammError
|
32
|
-
end
|
33
|
-
|
34
|
-
class AuthenticationError < JammError
|
35
|
-
end
|
36
26
|
end
|
data/lib/jamm/oauth.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rest-client'
|
2
4
|
require 'json'
|
3
5
|
require 'base64'
|
@@ -5,7 +7,7 @@ require 'jamm/errors'
|
|
5
7
|
|
6
8
|
module Jamm
|
7
9
|
module OAuth
|
8
|
-
def self.
|
10
|
+
def self.token
|
9
11
|
client_id = Jamm.client_id
|
10
12
|
client_secret = Jamm.client_secret
|
11
13
|
if client_id.nil? || client_secret.nil?
|
data/lib/jamm/version.rb
CHANGED
data/lib/jamm.rb
CHANGED
@@ -1,146 +1,33 @@
|
|
1
|
-
#
|
2
|
-
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
3
|
require 'rest-client'
|
4
4
|
require 'openssl'
|
5
5
|
require 'json'
|
6
6
|
|
7
|
-
require 'jamm/
|
8
|
-
require 'jamm/api_operations/get'
|
9
|
-
require 'jamm/api_operations/list'
|
10
|
-
require 'jamm/api_operations/update'
|
11
|
-
require 'jamm/version'
|
12
|
-
require 'jamm/oauth'
|
13
|
-
require 'jamm/request'
|
14
|
-
require 'jamm/api_resource'
|
15
|
-
require 'jamm/token'
|
16
|
-
require 'jamm/payment'
|
17
|
-
require 'jamm/charge'
|
18
|
-
require 'jamm/util'
|
19
|
-
require 'jamm/jamm_object'
|
7
|
+
require 'jamm/api'
|
20
8
|
require 'jamm/errors'
|
21
|
-
require 'jamm/
|
9
|
+
require 'jamm/oauth'
|
10
|
+
require 'jamm/version'
|
22
11
|
|
12
|
+
# Jamm Ruby SDK
|
23
13
|
module Jamm
|
24
|
-
|
25
|
-
@
|
14
|
+
# Configurable attributes.
|
15
|
+
@api_base = nil
|
16
|
+
@oauth_base = nil
|
26
17
|
@open_timeout = 30
|
27
18
|
@read_timeout = 90
|
28
19
|
@max_retry = 0
|
29
|
-
|
30
|
-
|
20
|
+
|
21
|
+
# Include OpenAPI generated module into root Jamm namespace.
|
22
|
+
# The OpenAPI sub-modules and methods can be accessed via Jamm::{foo}
|
23
|
+
include Api
|
31
24
|
|
32
25
|
class << self
|
33
|
-
attr_accessor :client_id, :client_secret, :api_base, :oauth_base, :api_version, :connect_base,
|
26
|
+
attr_accessor :api, :client_id, :client_secret, :api_base, :oauth_base, :api_version, :connect_base,
|
34
27
|
:open_timeout, :read_timeout, :max_retry, :retry_initial_delay, :retry_max_delay
|
35
28
|
end
|
36
29
|
|
37
|
-
def self.request_jamm_api(method, path, params = {}, headers = {})
|
38
|
-
access_token = OAuth.oauth_token
|
39
|
-
api_base_url = @api_base
|
40
|
-
open_timeout = @open_timeout
|
41
|
-
read_timeout = @read_timeout
|
42
|
-
max_retry = @max_retry
|
43
|
-
retry_initial_delay = @retry_initial_delay
|
44
|
-
retry_max_delay = @retry_max_delay
|
45
|
-
|
46
|
-
headers = {
|
47
|
-
authorization: "Bearer #{access_token}",
|
48
|
-
content_type: 'application/json',
|
49
|
-
X_JAMM_SDK_VERSION: "Ruby_#{VERSION}"
|
50
|
-
}.update(headers)
|
51
|
-
error_on_invalid_params(params)
|
52
|
-
|
53
|
-
url = api_url(path, api_base_url)
|
54
|
-
|
55
|
-
case method.to_s.downcase.to_sym
|
56
|
-
when :get, :head, :delete
|
57
|
-
# Make params into GET parameters
|
58
|
-
url + "#{URI.parse(url).query ? '&' : '?'}#{uri_encode(params)}" if params&.any?
|
59
|
-
payload = nil
|
60
|
-
else
|
61
|
-
payload = params.to_json
|
62
|
-
end
|
63
|
-
|
64
|
-
retry_count = 1
|
65
|
-
|
66
|
-
begin
|
67
|
-
response = execute_request(method: method, url: url, payload: payload, headers: headers,
|
68
|
-
read_timeout: read_timeout, open_timeout: open_timeout)
|
69
|
-
rescue SocketError
|
70
|
-
raise ApiConnectionError,
|
71
|
-
'An unexpected error happens while communicating to OAuth server. Check your network setting'
|
72
|
-
rescue RestClient::RequestTimeout
|
73
|
-
raise ApiConnectionError, "Timed out over #{read_timeout} sec."
|
74
|
-
rescue RestClient::ExceptionWithResponse => e
|
75
|
-
if (e.http_code == 429) && (retry_count <= max_retry)
|
76
|
-
sleep get_retry_delay(retry_count, retry_initial_delay, retry_max_delay)
|
77
|
-
retry_count += 1
|
78
|
-
retry
|
79
|
-
end
|
80
|
-
|
81
|
-
handle_api_error(e.http_code, e.http_body)
|
82
|
-
rescue RestClient::Exception => e
|
83
|
-
raise ApiError, "An unexpected error happens while communicating to Jamm server. #{e}"
|
84
|
-
end
|
85
|
-
|
86
|
-
parse(response)
|
87
|
-
end
|
88
|
-
|
89
|
-
def self.handle_api_error(http_code, http_body)
|
90
|
-
begin
|
91
|
-
error_obj = JSON.parse(http_body)
|
92
|
-
error_obj = Util.symbolize_names(error_obj)
|
93
|
-
error = error_obj[:error] or raise(ApiError) # escape from parsing
|
94
|
-
rescue JSON::ParserError, ApiError => e
|
95
|
-
raise ApiError.new "An unexpected error happens while parsing the error response. #{e}", http_status: http_code,
|
96
|
-
http_body: http_body
|
97
|
-
end
|
98
|
-
|
99
|
-
case http_code
|
100
|
-
when 400, 404
|
101
|
-
raise InvalidRequestError.new error, http_status: http_code, http_body: http_body, json_body: error_obj
|
102
|
-
when 401
|
103
|
-
raise AuthenticationError.new error, http_status: http_code, http_body: http_body, json_body: error_obj
|
104
|
-
else
|
105
|
-
raise ApiError.new error, http_status: http_code, http_body: http_body, json_body: error_obj
|
106
|
-
end
|
107
|
-
end
|
108
|
-
|
109
|
-
def self.parse(response)
|
110
|
-
begin
|
111
|
-
response = JSON.parse(response.body)
|
112
|
-
rescue JSON::ParserError
|
113
|
-
raise ApiError.new "Invalid response object from API: #{response.inspect}. HTTP response code: #{response.code})",
|
114
|
-
http_status: response.code, http_body: response.body
|
115
|
-
end
|
116
|
-
|
117
|
-
converted_response = Util.symbolize_names(response)
|
118
|
-
Util.convert_to_jamm_object(converted_response)
|
119
|
-
end
|
120
|
-
|
121
30
|
def self.execute_request(option)
|
122
31
|
RestClient::Request.execute(option)
|
123
32
|
end
|
124
|
-
|
125
|
-
def self.get_retry_delay(retry_count, retry_initial_delay, retry_max_delay)
|
126
|
-
# Exponential backoff
|
127
|
-
[retry_max_delay, retry_initial_delay * 2**retry_count].min
|
128
|
-
end
|
129
|
-
|
130
|
-
def self.uri_encode(params)
|
131
|
-
Util.flatten_params(params)
|
132
|
-
.map { |k, v| "#{k}=#{Util.url_encode(v)}" }.join('&')
|
133
|
-
end
|
134
|
-
|
135
|
-
def self.api_url(url, api_base_url)
|
136
|
-
api_base_url + url
|
137
|
-
end
|
138
|
-
|
139
|
-
def self.error_on_invalid_params(params)
|
140
|
-
return if params.nil? || params.is_a?(Hash)
|
141
|
-
|
142
|
-
raise ArgumentError,
|
143
|
-
'request params should be either a Hash or nil ' \
|
144
|
-
"(was a #{params.class})"
|
145
|
-
end
|
146
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jamm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamm
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -24,52 +24,80 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: typhoeus
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.0'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 1.0.1
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '1.0'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 1.0.1
|
27
47
|
description: Jamm help you make payment without credit cards
|
28
48
|
email: support@jamm-pay.jp
|
29
49
|
executables: []
|
30
50
|
extensions: []
|
31
51
|
extra_rdoc_files: []
|
32
52
|
files:
|
33
|
-
- ".github/workflows/build.yml"
|
34
|
-
- ".github/workflows/ruby-publish.yml"
|
35
53
|
- ".gitignore"
|
36
54
|
- ".rubocop.yml"
|
37
|
-
- CONTRIBUTORS
|
38
55
|
- Gemfile
|
56
|
+
- Gemfile.lock
|
39
57
|
- LICENSE
|
40
58
|
- README.md
|
41
59
|
- Rakefile
|
42
|
-
- images/jamm_logo.png
|
43
60
|
- jamm.gemspec
|
44
61
|
- lib/jamm.rb
|
45
|
-
- lib/jamm/
|
46
|
-
- lib/jamm/
|
47
|
-
- lib/jamm/
|
48
|
-
- lib/jamm/
|
49
|
-
- lib/jamm/
|
50
|
-
- lib/jamm/
|
62
|
+
- lib/jamm/api.rb
|
63
|
+
- lib/jamm/api/api/customer_api.rb
|
64
|
+
- lib/jamm/api/api/healthcheck_api.rb
|
65
|
+
- lib/jamm/api/api/payment_api.rb
|
66
|
+
- lib/jamm/api/api_client.rb
|
67
|
+
- lib/jamm/api/api_error.rb
|
68
|
+
- lib/jamm/api/configuration.rb
|
69
|
+
- lib/jamm/api/models/customer_service_update_customer_body.rb
|
70
|
+
- lib/jamm/api/models/protobuf_any.rb
|
71
|
+
- lib/jamm/api/models/rpc_status.rb
|
72
|
+
- lib/jamm/api/models/v1_buyer.rb
|
73
|
+
- lib/jamm/api/models/v1_charge.rb
|
74
|
+
- lib/jamm/api/models/v1_contract.rb
|
75
|
+
- lib/jamm/api/models/v1_create_contract_with_charge_request.rb
|
76
|
+
- lib/jamm/api/models/v1_create_contract_with_charge_response.rb
|
77
|
+
- lib/jamm/api/models/v1_create_contract_without_charge_request.rb
|
78
|
+
- lib/jamm/api/models/v1_create_contract_without_charge_response.rb
|
79
|
+
- lib/jamm/api/models/v1_create_customer_request.rb
|
80
|
+
- lib/jamm/api/models/v1_create_customer_response.rb
|
81
|
+
- lib/jamm/api/models/v1_customer.rb
|
82
|
+
- lib/jamm/api/models/v1_delete_customer_response.rb
|
83
|
+
- lib/jamm/api/models/v1_get_customer_response.rb
|
84
|
+
- lib/jamm/api/models/v1_initial_charge.rb
|
85
|
+
- lib/jamm/api/models/v1_merchant.rb
|
86
|
+
- lib/jamm/api/models/v1_merchant_customer.rb
|
87
|
+
- lib/jamm/api/models/v1_payment_link.rb
|
88
|
+
- lib/jamm/api/models/v1_ping_response.rb
|
89
|
+
- lib/jamm/api/models/v1_update_customer_response.rb
|
90
|
+
- lib/jamm/api/models/v1_url.rb
|
91
|
+
- lib/jamm/api/version.rb
|
51
92
|
- lib/jamm/errors.rb
|
52
|
-
- lib/jamm/jamm_object.rb
|
53
93
|
- lib/jamm/oauth.rb
|
54
|
-
- lib/jamm/payment.rb
|
55
|
-
- lib/jamm/request.rb
|
56
|
-
- lib/jamm/time_util.rb
|
57
|
-
- lib/jamm/token.rb
|
58
|
-
- lib/jamm/util.rb
|
59
94
|
- lib/jamm/version.rb
|
60
|
-
|
61
|
-
- test/jamm/oauth_test.rb
|
62
|
-
- test/jamm/payment_test.rb
|
63
|
-
- test/jamm/time_util_test.rb
|
64
|
-
- test/jamm/token_test.rb
|
65
|
-
- test/test_data.rb
|
66
|
-
- test/test_helper.rb
|
67
|
-
homepage: ''
|
95
|
+
homepage: https://jamm-pay.jp
|
68
96
|
licenses:
|
69
97
|
- MIT
|
70
98
|
metadata:
|
71
99
|
source_code_uri: https://github.com/jamm-pay/Jamm-SDK-Ruby
|
72
|
-
post_install_message:
|
100
|
+
post_install_message:
|
73
101
|
rdoc_options: []
|
74
102
|
require_paths:
|
75
103
|
- lib
|
@@ -84,15 +112,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
84
112
|
- !ruby/object:Gem::Version
|
85
113
|
version: '0'
|
86
114
|
requirements: []
|
87
|
-
rubygems_version: 3.
|
88
|
-
signing_key:
|
115
|
+
rubygems_version: 3.2.3
|
116
|
+
signing_key:
|
89
117
|
specification_version: 4
|
90
118
|
summary: Ruby SDK for the Jamm API
|
91
|
-
test_files:
|
92
|
-
- test/jamm/charge_test.rb
|
93
|
-
- test/jamm/oauth_test.rb
|
94
|
-
- test/jamm/payment_test.rb
|
95
|
-
- test/jamm/time_util_test.rb
|
96
|
-
- test/jamm/token_test.rb
|
97
|
-
- test/test_data.rb
|
98
|
-
- test/test_helper.rb
|
119
|
+
test_files: []
|
data/.github/workflows/build.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
name: Multibranch Ruby CI Flow
|
2
|
-
|
3
|
-
on:
|
4
|
-
pull_request:
|
5
|
-
branches:
|
6
|
-
- main
|
7
|
-
push:
|
8
|
-
branches:
|
9
|
-
- main
|
10
|
-
|
11
|
-
jobs:
|
12
|
-
build:
|
13
|
-
runs-on: ubuntu-latest
|
14
|
-
steps:
|
15
|
-
- uses: actions/checkout@v4
|
16
|
-
- name: Ruby setup
|
17
|
-
uses: ruby/setup-ruby@v1
|
18
|
-
with:
|
19
|
-
ruby-version: "3.2.2"
|
20
|
-
- name: Install dependencies
|
21
|
-
run: bundle install
|
22
|
-
- name: Run Test
|
23
|
-
run: bundle exec rake
|
@@ -1,24 +0,0 @@
|
|
1
|
-
name: Publish Ruby Package
|
2
|
-
|
3
|
-
on:
|
4
|
-
release:
|
5
|
-
types: [published]
|
6
|
-
|
7
|
-
jobs:
|
8
|
-
deploy:
|
9
|
-
|
10
|
-
runs-on: ubuntu-latest
|
11
|
-
|
12
|
-
steps:
|
13
|
-
- uses: actions/checkout@v4
|
14
|
-
- name: Set up Ruby
|
15
|
-
uses: ruby/setup-ruby@v1
|
16
|
-
with:
|
17
|
-
ruby-version: '3.2'
|
18
|
-
bundler-cache: true
|
19
|
-
- name: Build and publish
|
20
|
-
env:
|
21
|
-
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
22
|
-
run: |
|
23
|
-
bundle exec rake build
|
24
|
-
bundle exec gem push pkg/jamm-*.gem
|
data/CONTRIBUTORS
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
Tomu Hirata tomu.hirata@gmail.com
|
data/images/jamm_logo.png
DELETED
Binary file
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jamm
|
4
|
-
module APIOperations
|
5
|
-
module Create
|
6
|
-
def create(params = {}, headers = {})
|
7
|
-
request_jamm_api(
|
8
|
-
method: :post,
|
9
|
-
path: resource_url,
|
10
|
-
params: params,
|
11
|
-
headers: headers
|
12
|
-
)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jamm
|
4
|
-
module APIOperations
|
5
|
-
module Get
|
6
|
-
def get(id, params = {}, headers = {})
|
7
|
-
request_jamm_api(
|
8
|
-
method: :get,
|
9
|
-
path: "#{resource_url}/#{id}",
|
10
|
-
params: params,
|
11
|
-
headers: headers
|
12
|
-
)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jamm
|
4
|
-
module APIOperations
|
5
|
-
module List
|
6
|
-
def list(params = {}, headers = {})
|
7
|
-
request_jamm_api(
|
8
|
-
method: :get,
|
9
|
-
path: resource_url,
|
10
|
-
params: params,
|
11
|
-
headers: headers
|
12
|
-
)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Jamm
|
4
|
-
module APIOperations
|
5
|
-
module Update
|
6
|
-
def update(id, params = {}, headers = {})
|
7
|
-
request_jamm_api(
|
8
|
-
method: :patch,
|
9
|
-
path: "#{resource_url}/#{id}",
|
10
|
-
params: params,
|
11
|
-
headers: headers
|
12
|
-
)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
data/lib/jamm/api_resource.rb
DELETED