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.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -57
  3. data/.rubocop.yml +18 -25
  4. data/Gemfile +4 -0
  5. data/Gemfile.lock +99 -0
  6. data/README.md +4 -4
  7. data/Rakefile +2 -0
  8. data/jamm.gemspec +16 -3
  9. data/lib/jamm/api/api/customer_api.rb +265 -0
  10. data/lib/jamm/api/api/healthcheck_api.rb +76 -0
  11. data/lib/jamm/api/api/payment_api.rb +145 -0
  12. data/lib/jamm/api/api_client.rb +385 -0
  13. data/lib/jamm/api/api_error.rb +58 -0
  14. data/lib/jamm/api/configuration.rb +293 -0
  15. data/lib/jamm/api/models/customer_service_update_customer_body.rb +247 -0
  16. data/lib/jamm/api/models/protobuf_any.rb +209 -0
  17. data/lib/jamm/api/models/rpc_status.rb +218 -0
  18. data/lib/jamm/api/models/v1_buyer.rb +274 -0
  19. data/lib/jamm/api/models/v1_charge.rb +233 -0
  20. data/lib/jamm/api/models/v1_contract.rb +225 -0
  21. data/lib/jamm/api/models/v1_create_contract_with_charge_request.rb +217 -0
  22. data/lib/jamm/api/models/v1_create_contract_with_charge_response.rb +222 -0
  23. data/lib/jamm/api/models/v1_create_contract_without_charge_request.rb +212 -0
  24. data/lib/jamm/api/models/v1_create_contract_without_charge_response.rb +217 -0
  25. data/lib/jamm/api/models/v1_create_customer_request.rb +207 -0
  26. data/lib/jamm/api/models/v1_create_customer_response.rb +207 -0
  27. data/lib/jamm/api/models/v1_customer.rb +223 -0
  28. data/lib/jamm/api/models/v1_delete_customer_response.rb +207 -0
  29. data/lib/jamm/api/models/v1_get_customer_response.rb +207 -0
  30. data/lib/jamm/api/models/v1_initial_charge.rb +225 -0
  31. data/lib/jamm/api/models/v1_merchant.rb +212 -0
  32. data/lib/jamm/api/models/v1_merchant_customer.rb +213 -0
  33. data/lib/jamm/api/models/v1_payment_link.rb +221 -0
  34. data/lib/jamm/api/models/v1_ping_response.rb +207 -0
  35. data/lib/jamm/api/models/v1_update_customer_response.rb +207 -0
  36. data/lib/jamm/api/models/v1_url.rb +216 -0
  37. data/lib/jamm/api/version.rb +15 -0
  38. data/lib/jamm/api.rb +64 -0
  39. data/lib/jamm/errors.rb +4 -14
  40. data/lib/jamm/oauth.rb +3 -1
  41. data/lib/jamm/version.rb +3 -1
  42. data/lib/jamm.rb +14 -127
  43. metadata +59 -38
  44. data/.github/workflows/build.yml +0 -23
  45. data/.github/workflows/ruby-publish.yml +0 -24
  46. data/CONTRIBUTORS +0 -1
  47. data/images/jamm_logo.png +0 -0
  48. data/lib/jamm/api_operations/create.rb +0 -16
  49. data/lib/jamm/api_operations/get.rb +0 -16
  50. data/lib/jamm/api_operations/list.rb +0 -16
  51. data/lib/jamm/api_operations/update.rb +0 -16
  52. data/lib/jamm/api_resource.rb +0 -5
  53. data/lib/jamm/charge.rb +0 -10
  54. data/lib/jamm/jamm_object.rb +0 -249
  55. data/lib/jamm/payment.rb +0 -18
  56. data/lib/jamm/request.rb +0 -13
  57. data/lib/jamm/time_util.rb +0 -41
  58. data/lib/jamm/token.rb +0 -10
  59. data/lib/jamm/util.rb +0 -76
  60. data/test/jamm/charge_test.rb +0 -56
  61. data/test/jamm/oauth_test.rb +0 -47
  62. data/test/jamm/payment_test.rb +0 -17
  63. data/test/jamm/time_util_test.rb +0 -18
  64. data/test/jamm/token_test.rb +0 -52
  65. data/test/test_data.rb +0 -118
  66. data/test/test_helper.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f327c3134101945f2fae416640e630efb160d4b1d68679d925689a73023fbabd
4
- data.tar.gz: 3044598aaa52335f986638a8989dcae84ac7805f8676ee67e94f70896b391405
3
+ metadata.gz: c402328942c6868efbc16b8055c6dba5c59c1576e610cfd6402f145d08c3d8a3
4
+ data.tar.gz: 148d0550827b88f22de19d79d1fca3b2fb649e4a138b728b7ac57a866e02283a
5
5
  SHA512:
6
- metadata.gz: '08c55977ae46c049e48f7933ed2926d511562f96f4a3875f61ae9790611a392efe6fc075916675ff6b69eb2409e295e8c302a02a84cc058eb0b09231b176354d'
7
- data.tar.gz: a74807913f38478fba27cbb5df6914089253d34223091a5638289aa398dc9b5cc8de0411ea5247f19cbc026af02981b437e23b1a9b181d4a5ad357dfda1cb43c
6
+ metadata.gz: 9b4e508e9499f0412ed1f1d6939d1b00b6465e0184c0f994c09db70de73936731c7d376a1d702b75252b9f9ae4a87119ddb31dc413721c4eba0619fe0e5bea22
7
+ data.tar.gz: de45614662b6d47ceec6ce476af65654b74fad81c6e9c083ca99f116458f2b6e83d0abe9c16c52b97e322d43f3ed3c32d9c6f9e362ea67cc27d07935b0d2c75e
data/.gitignore CHANGED
@@ -1,57 +1,6 @@
1
- *.gem
2
- *.rbc
3
- *.lock
4
- /.config
5
- /coverage/
6
- /InstalledFiles
7
- /pkg/
8
- /spec/reports/
9
- /spec/examples.txt
10
- /test/tmp/
11
- /test/version_tmp/
12
- /tmp/
13
-
14
- # Used by dotenv library to load environment variables.
15
- # .env
16
-
17
- # Ignore Byebug command history file.
18
- .byebug_history
19
-
20
- ## Specific to RubyMotion:
21
- .dat*
22
- .repl_history
23
- build/
24
- *.bridgesupport
25
- build-iPhoneOS/
26
- build-iPhoneSimulator/
27
-
28
- ## Specific to RubyMotion (use of CocoaPods):
29
- #
30
- # We recommend against adding the Pods directory to your .gitignore. However
31
- # you should judge for yourself, the pros and cons are mentioned at:
32
- # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
33
- #
34
- # vendor/Pods/
35
-
36
- ## Documentation cache and generated files:
37
- /.yardoc/
38
- /_yardoc/
39
- /doc/
40
- /rdoc/
41
-
42
- ## Environment normalization:
43
- /.bundle/
44
- /vendor/bundle
45
- /lib/bundler/man/
46
-
47
- # for a library or gem, you might want to ignore these files since the code is
48
- # intended to run in multiple environments; otherwise, check them in:
49
- # Gemfile.lock
50
- # .ruby-version
51
- # .ruby-gemset
52
-
53
- # unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
54
- .rvmrc
55
-
56
- # Used by RuboCop. Remote config files pulled in from inherit_from directive.
57
- # .rubocop-https?--*
1
+ .bundle
2
+ *.jar
3
+ openapi/gen
4
+ openapi/tmp
5
+ pkg
6
+ vendor
data/.rubocop.yml CHANGED
@@ -1,53 +1,46 @@
1
- # The behavior of RuboCop can be controlled via the .rubocop.yml
2
- # configuration file. It makes it possible to enable/disable
3
- # certain cops (checks) and to alter their behavior if they accept
4
- # any parameters. The file can be placed either in your home
5
- # directory or in some project directory.
6
- #
7
- # RuboCop will start looking for the configuration file in the directory
8
- # where the inspected file is and continue its way up to the root directory.
9
- #
10
- # See https://docs.rubocop.org/rubocop/configuration
1
+ AllCops:
2
+ Exclude:
3
+ - 'images/**/*'
4
+ - 'lib/jamm/proto/**/*'
11
5
 
12
- Style/FrozenStringLiteralComment:
6
+ Lint/DuplicateMethods:
13
7
  Enabled: false
14
8
 
15
- Style/MutableConstant:
9
+ Layout/LineLength:
16
10
  Enabled: false
17
11
 
18
- Metrics/MethodLength:
12
+ Lint/UriEscapeUnescape:
19
13
  Enabled: false
20
14
 
21
- Style/Documentation:
15
+ Lint/UnderscorePrefixedVariableName:
22
16
  Enabled: false
23
17
 
24
- Lint/MissingSuper:
18
+ Metrics/AbcSize:
25
19
  Enabled: false
26
20
 
27
- Metrics/ModuleLength:
21
+ Metrics/ClassLength:
28
22
  Enabled: false
29
23
 
30
- Layout/LineLength:
24
+ Metrics/CyclomaticComplexity:
31
25
  Enabled: false
32
26
 
33
- Metrics/AbcSize:
27
+ Metrics/ModuleLength:
34
28
  Enabled: false
35
29
 
36
- Metrics/CyclomaticComplexity:
30
+ Metrics/MethodLength:
37
31
  Enabled: false
38
32
 
39
- Metrics/ClassLength:
33
+ Metrics/PerceivedComplexity:
40
34
  Enabled: false
41
35
 
42
36
  Naming/MethodParameterName:
43
37
  Enabled: false
44
38
 
45
- Security/MarshalLoad:
39
+ Style/ClassVars:
46
40
  Enabled: false
47
41
 
48
- Metrics/PerceivedComplexity:
42
+ Style/Documentation:
49
43
  Enabled: false
50
44
 
51
- AllCops:
52
- SuggestExtensions: false
53
- NewCops: disable
45
+ Style/HashSyntax:
46
+ Enabled: false
data/Gemfile CHANGED
@@ -1,11 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  gemspec
4
6
 
5
7
  gem 'rest-client', '~> 2.0'
8
+ gem 'typhoeus', '~> 1.0', '>= 1.0.1'
6
9
 
7
10
  group :development, :test do
8
11
  gem 'mocha'
12
+ gem 'pry', '~> 0.14.2'
9
13
  gem 'rake'
10
14
  gem 'rubocop'
11
15
  gem 'test-unit'
data/Gemfile.lock ADDED
@@ -0,0 +1,99 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ jamm (1.0.1)
5
+ rest-client (~> 2.0)
6
+ typhoeus (~> 1.0, >= 1.0.1)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ addressable (2.8.6)
12
+ public_suffix (>= 2.0.2, < 6.0)
13
+ ast (2.4.2)
14
+ bigdecimal (3.1.7)
15
+ coderay (1.1.3)
16
+ crack (1.0.0)
17
+ bigdecimal
18
+ rexml
19
+ domain_name (0.6.20240107)
20
+ ethon (0.16.0)
21
+ ffi (>= 1.15.0)
22
+ ffi (1.17.0)
23
+ hashdiff (1.1.0)
24
+ http-accept (1.7.0)
25
+ http-cookie (1.0.5)
26
+ domain_name (~> 0.5)
27
+ json (2.7.2)
28
+ language_server-protocol (3.17.0.3)
29
+ method_source (1.1.0)
30
+ mime-types (3.5.2)
31
+ mime-types-data (~> 3.2015)
32
+ mime-types-data (3.2024.0305)
33
+ mocha (2.2.0)
34
+ ruby2_keywords (>= 0.0.5)
35
+ netrc (0.11.0)
36
+ parallel (1.24.0)
37
+ parser (3.3.0.5)
38
+ ast (~> 2.4.1)
39
+ racc
40
+ power_assert (2.0.3)
41
+ pry (0.14.2)
42
+ coderay (~> 1.1)
43
+ method_source (~> 1.0)
44
+ public_suffix (5.0.5)
45
+ racc (1.7.3)
46
+ rainbow (3.1.1)
47
+ rake (13.2.1)
48
+ regexp_parser (2.9.0)
49
+ rest-client (2.1.0)
50
+ http-accept (>= 1.7.0, < 2.0)
51
+ http-cookie (>= 1.0.2, < 2.0)
52
+ mime-types (>= 1.16, < 4.0)
53
+ netrc (~> 0.8)
54
+ rexml (3.3.6)
55
+ strscan
56
+ rubocop (1.63.3)
57
+ json (~> 2.3)
58
+ language_server-protocol (>= 3.17.0)
59
+ parallel (~> 1.10)
60
+ parser (>= 3.3.0.2)
61
+ rainbow (>= 2.2.2, < 4.0)
62
+ regexp_parser (>= 1.8, < 3.0)
63
+ rexml (>= 3.2.5, < 4.0)
64
+ rubocop-ast (>= 1.31.1, < 2.0)
65
+ ruby-progressbar (~> 1.7)
66
+ unicode-display_width (>= 2.4.0, < 3.0)
67
+ rubocop-ast (1.31.2)
68
+ parser (>= 3.3.0.4)
69
+ ruby-progressbar (1.13.0)
70
+ ruby2_keywords (0.0.5)
71
+ strscan (3.1.0)
72
+ test-unit (3.6.2)
73
+ power_assert
74
+ typhoeus (1.4.1)
75
+ ethon (>= 0.9.0)
76
+ unicode-display_width (2.5.0)
77
+ webmock (3.23.0)
78
+ addressable (>= 2.8.0)
79
+ crack (>= 0.3.2)
80
+ hashdiff (>= 0.4.0, < 2.0.0)
81
+
82
+ PLATFORMS
83
+ aarch64-linux
84
+ arm64-darwin-22
85
+ x86_64-linux
86
+
87
+ DEPENDENCIES
88
+ jamm!
89
+ mocha
90
+ pry (~> 0.14.2)
91
+ rake
92
+ rest-client (~> 2.0)
93
+ rubocop
94
+ test-unit
95
+ typhoeus (~> 1.0, >= 1.0.1)
96
+ webmock
97
+
98
+ BUNDLED WITH
99
+ 2.3.7
data/README.md CHANGED
@@ -25,8 +25,8 @@ Jamm.client_id = '<your client id>'
25
25
  Jamm.client_secret = '<your client id>'
26
26
  Jamm.open_timeout = 30 # optionally
27
27
  Jamm.read_timeout = 90 # optionally
28
- # ex, create a deduction contract token
29
- deduction_token = Jamm::Payment.create(
28
+ # ex, make a payment
29
+ payment = Jamm::Payment.create(
30
30
  initial_charge: {
31
31
  description: 'Jamm',
32
32
  initial_amount: 10_000,
@@ -48,9 +48,9 @@ deduction_token = Jamm::Payment.create(
48
48
  katakanaLastName: "タロ",
49
49
  gender: "MALE",
50
50
  postNum: "112-0001",
51
- address: "東京都渋谷区1−1−1"
51
+ address: "東京都渋谷区1−1−1",
52
52
  email: "test@jamm-pay.jp",
53
- phone: "010-1234-5678"
53
+ phone: "010-1234-5678",
54
54
  birthdate: "2000-01-01",
55
55
  },
56
56
  options: {
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake/testtask'
2
4
  require 'rubocop/rake_task'
3
5
  require 'bundler/gem_tasks'
data/jamm.gemspec CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), 'lib'))
2
4
 
3
5
  require 'jamm/version'
@@ -10,13 +12,24 @@ Gem::Specification.new do |s|
10
12
  s.description = 'Jamm help you make payment without credit cards'
11
13
  s.authors = ['Jamm']
12
14
  s.email = 'support@jamm-pay.jp'
13
- s.homepage = ''
15
+ s.homepage = 'https://jamm-pay.jp'
14
16
  s.license = 'MIT'
15
17
 
16
18
  s.add_dependency('rest-client', '~> 2.0')
19
+ s.add_dependency('typhoeus', '~> 1.0', '>= 1.0.1')
20
+
21
+ s.files = `git ls-files`.split("\n").reject do |file|
22
+ file.start_with?(
23
+ "examples",
24
+ "images",
25
+ "openapi",
26
+ "pkg",
27
+ "test",
28
+ "Makefile",
29
+ )
30
+ end
17
31
 
18
- s.files = `git ls-files`.split("\n")
19
- s.test_files = `git ls-files -- test/*`.split("\n")
32
+ s.test_files = []
20
33
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
21
34
  s.require_paths = ['lib']
22
35
 
@@ -0,0 +1,265 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #api/v1/common.proto
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: version not set
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ require 'cgi'
14
+
15
+ module Api
16
+ class CustomerApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Create customer
24
+ # Intended for pre-registering merchant customer into Jamm.
25
+ # @param body [CreateCustomerRequest]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [CreateCustomerResponse]
28
+ def create(body, opts = {})
29
+ data, _status_code, _headers = create_with_http_info(body, opts)
30
+ data
31
+ end
32
+
33
+ # Create customer
34
+ # Intended for pre-registering merchant customer into Jamm.
35
+ # @param body [CreateCustomerRequest]
36
+ # @param [Hash] opts the optional parameters
37
+ # @return [Array<(CreateCustomerResponse, Integer, Hash)>] CreateCustomerResponse data, response status code and response headers
38
+ def create_with_http_info(body, opts = {})
39
+ @api_client.config.logger.debug 'Calling API: CustomerApi.create ...' if @api_client.config.debugging
40
+ # verify the required parameter 'body' is set
41
+ raise ArgumentError, "Missing the required parameter 'body' when calling CustomerApi.create" if @api_client.config.client_side_validation && body.nil?
42
+
43
+ # resource path
44
+ local_var_path = '/v1/customers'
45
+
46
+ # query parameters
47
+ query_params = opts[:query_params] || {}
48
+
49
+ # header parameters
50
+ header_params = opts[:header_params] || {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
53
+ # HTTP header 'Content-Type'
54
+ content_type = @api_client.select_header_content_type(['application/json'])
55
+ header_params['Content-Type'] = content_type unless content_type.nil?
56
+
57
+ # form parameters
58
+ form_params = opts[:form_params] || {}
59
+
60
+ # http body (model)
61
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
62
+
63
+ # return_type
64
+ return_type = opts[:debug_return_type] || 'CreateCustomerResponse'
65
+
66
+ # auth_names
67
+ auth_names = opts[:debug_auth_names] || []
68
+
69
+ new_options = opts.merge(
70
+ :operation => :"CustomerApi.create",
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ @api_client.config.logger.debug "API called: CustomerApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
81
+ [data, status_code, headers]
82
+ end
83
+
84
+ # Delete customer
85
+ # Delete customer from Jamm.
86
+ # @param customer [String]
87
+ # @param [Hash] opts the optional parameters
88
+ # @return [DeleteCustomerResponse]
89
+ def delete(customer, opts = {})
90
+ data, _status_code, _headers = delete_with_http_info(customer, opts)
91
+ data
92
+ end
93
+
94
+ # Delete customer
95
+ # Delete customer from Jamm.
96
+ # @param customer [String]
97
+ # @param [Hash] opts the optional parameters
98
+ # @return [Array<(DeleteCustomerResponse, Integer, Hash)>] DeleteCustomerResponse data, response status code and response headers
99
+ def delete_with_http_info(customer, opts = {})
100
+ @api_client.config.logger.debug 'Calling API: CustomerApi.delete ...' if @api_client.config.debugging
101
+ # verify the required parameter 'customer' is set
102
+ raise ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.delete" if @api_client.config.client_side_validation && customer.nil?
103
+
104
+ # resource path
105
+ local_var_path = '/v1/customers/{customer}'.sub('{customer}', CGI.escape(customer.to_s))
106
+
107
+ # query parameters
108
+ query_params = opts[:query_params] || {}
109
+
110
+ # header parameters
111
+ header_params = opts[:header_params] || {}
112
+ # HTTP header 'Accept' (if needed)
113
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
114
+
115
+ # form parameters
116
+ form_params = opts[:form_params] || {}
117
+
118
+ # http body (model)
119
+ post_body = opts[:debug_body]
120
+
121
+ # return_type
122
+ return_type = opts[:debug_return_type] || 'DeleteCustomerResponse'
123
+
124
+ # auth_names
125
+ auth_names = opts[:debug_auth_names] || []
126
+
127
+ new_options = opts.merge(
128
+ :operation => :"CustomerApi.delete",
129
+ :header_params => header_params,
130
+ :query_params => query_params,
131
+ :form_params => form_params,
132
+ :body => post_body,
133
+ :auth_names => auth_names,
134
+ :return_type => return_type
135
+ )
136
+
137
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
138
+ @api_client.config.logger.debug "API called: CustomerApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
139
+ [data, status_code, headers]
140
+ end
141
+
142
+ # Get customer
143
+ # Retrieve a merchant customer from Jamm. The merchant customer must be registered in Jamm.
144
+ # @param customer [String]
145
+ # @param [Hash] opts the optional parameters
146
+ # @return [GetCustomerResponse]
147
+ def get(customer, opts = {})
148
+ data, _status_code, _headers = get_with_http_info(customer, opts)
149
+ data
150
+ end
151
+
152
+ # Get customer
153
+ # Retrieve a merchant customer from Jamm. The merchant customer must be registered in Jamm.
154
+ # @param customer [String]
155
+ # @param [Hash] opts the optional parameters
156
+ # @return [Array<(GetCustomerResponse, Integer, Hash)>] GetCustomerResponse data, response status code and response headers
157
+ def get_with_http_info(customer, opts = {})
158
+ @api_client.config.logger.debug 'Calling API: CustomerApi.get ...' if @api_client.config.debugging
159
+ # verify the required parameter 'customer' is set
160
+ raise ArgumentError, "Missing the required parameter 'customer' when calling CustomerApi.get" if @api_client.config.client_side_validation && customer.nil?
161
+
162
+ # resource path
163
+ local_var_path = '/v1/customers/{customer}'.sub('{customer}', CGI.escape(customer.to_s))
164
+
165
+ # query parameters
166
+ query_params = opts[:query_params] || {}
167
+
168
+ # header parameters
169
+ header_params = opts[:header_params] || {}
170
+ # HTTP header 'Accept' (if needed)
171
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
172
+
173
+ # form parameters
174
+ form_params = opts[:form_params] || {}
175
+
176
+ # http body (model)
177
+ post_body = opts[:debug_body]
178
+
179
+ # return_type
180
+ return_type = opts[:debug_return_type] || 'GetCustomerResponse'
181
+
182
+ # auth_names
183
+ auth_names = opts[:debug_auth_names] || []
184
+
185
+ new_options = opts.merge(
186
+ :operation => :"CustomerApi.get",
187
+ :header_params => header_params,
188
+ :query_params => query_params,
189
+ :form_params => form_params,
190
+ :body => post_body,
191
+ :auth_names => auth_names,
192
+ :return_type => return_type
193
+ )
194
+
195
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
196
+ @api_client.config.logger.debug "API called: CustomerApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
197
+ [data, status_code, headers]
198
+ end
199
+
200
+ # Update customer
201
+ # Update customer metadata when they updated their information in merchant e-commerce store.
202
+ # @param id [String] Immutable
203
+ # @param body [CustomerServiceUpdateCustomerBody]
204
+ # @param [Hash] opts the optional parameters
205
+ # @return [UpdateCustomerResponse]
206
+ def update(id, body, opts = {})
207
+ data, _status_code, _headers = update_with_http_info(id, body, opts)
208
+ data
209
+ end
210
+
211
+ # Update customer
212
+ # Update customer metadata when they updated their information in merchant e-commerce store.
213
+ # @param id [String] Immutable
214
+ # @param body [CustomerServiceUpdateCustomerBody]
215
+ # @param [Hash] opts the optional parameters
216
+ # @return [Array<(UpdateCustomerResponse, Integer, Hash)>] UpdateCustomerResponse data, response status code and response headers
217
+ def update_with_http_info(id, body, opts = {})
218
+ @api_client.config.logger.debug 'Calling API: CustomerApi.update ...' if @api_client.config.debugging
219
+ # verify the required parameter 'id' is set
220
+ raise ArgumentError, "Missing the required parameter 'id' when calling CustomerApi.update" if @api_client.config.client_side_validation && id.nil?
221
+ # verify the required parameter 'body' is set
222
+ raise ArgumentError, "Missing the required parameter 'body' when calling CustomerApi.update" if @api_client.config.client_side_validation && body.nil?
223
+
224
+ # resource path
225
+ local_var_path = '/v1/customers/{id}'.sub('{id}', CGI.escape(id.to_s))
226
+
227
+ # query parameters
228
+ query_params = opts[:query_params] || {}
229
+
230
+ # header parameters
231
+ header_params = opts[:header_params] || {}
232
+ # HTTP header 'Accept' (if needed)
233
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
234
+ # HTTP header 'Content-Type'
235
+ content_type = @api_client.select_header_content_type(['application/json'])
236
+ header_params['Content-Type'] = content_type unless content_type.nil?
237
+
238
+ # form parameters
239
+ form_params = opts[:form_params] || {}
240
+
241
+ # http body (model)
242
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
243
+
244
+ # return_type
245
+ return_type = opts[:debug_return_type] || 'UpdateCustomerResponse'
246
+
247
+ # auth_names
248
+ auth_names = opts[:debug_auth_names] || []
249
+
250
+ new_options = opts.merge(
251
+ :operation => :"CustomerApi.update",
252
+ :header_params => header_params,
253
+ :query_params => query_params,
254
+ :form_params => form_params,
255
+ :body => post_body,
256
+ :auth_names => auth_names,
257
+ :return_type => return_type
258
+ )
259
+
260
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
261
+ @api_client.config.logger.debug "API called: CustomerApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
262
+ [data, status_code, headers]
263
+ end
264
+ end
265
+ end
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ # #api/v1/common.proto
4
+ #
5
+ # No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ #
7
+ # The version of the OpenAPI document: version not set
8
+ #
9
+ # Generated by: https://openapi-generator.tech
10
+ # Generator version: 7.9.0
11
+ #
12
+
13
+ require 'cgi'
14
+
15
+ module Api
16
+ class HealthcheckApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+
23
+ # Ping Jamm server to check connection
24
+ # Ping Jamm server to check connection
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [PingResponse]
27
+ def ping(opts = {})
28
+ data, _status_code, _headers = ping_with_http_info(opts)
29
+ data
30
+ end
31
+
32
+ # Ping Jamm server to check connection
33
+ # Ping Jamm server to check connection
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [Array<(PingResponse, Integer, Hash)>] PingResponse data, response status code and response headers
36
+ def ping_with_http_info(opts = {})
37
+ @api_client.config.logger.debug 'Calling API: HealthcheckApi.ping ...' if @api_client.config.debugging
38
+ # resource path
39
+ local_var_path = '/v1/healthcheck'
40
+
41
+ # query parameters
42
+ query_params = opts[:query_params] || {}
43
+
44
+ # header parameters
45
+ header_params = opts[:header_params] || {}
46
+ # HTTP header 'Accept' (if needed)
47
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
48
+
49
+ # form parameters
50
+ form_params = opts[:form_params] || {}
51
+
52
+ # http body (model)
53
+ post_body = opts[:debug_body]
54
+
55
+ # return_type
56
+ return_type = opts[:debug_return_type] || 'PingResponse'
57
+
58
+ # auth_names
59
+ auth_names = opts[:debug_auth_names] || []
60
+
61
+ new_options = opts.merge(
62
+ :operation => :"HealthcheckApi.ping",
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => return_type
69
+ )
70
+
71
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
72
+ @api_client.config.logger.debug "API called: HealthcheckApi#ping\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" if @api_client.config.debugging
73
+ [data, status_code, headers]
74
+ end
75
+ end
76
+ end