terminal-shop 1.6.0 → 1.8.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.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -1
  3. data/lib/terminal-shop/base_client.rb +36 -46
  4. data/lib/terminal-shop/base_model.rb +88 -128
  5. data/lib/terminal-shop/base_page.rb +18 -18
  6. data/lib/terminal-shop/client.rb +1 -3
  7. data/lib/terminal-shop/errors.rb +12 -17
  8. data/lib/terminal-shop/extern.rb +1 -4
  9. data/lib/terminal-shop/models/region.rb +15 -0
  10. data/lib/terminal-shop/models/subscription.rb +6 -0
  11. data/lib/terminal-shop/models/view_init_response.rb +3 -13
  12. data/lib/terminal-shop/pooled_net_requester.rb +19 -21
  13. data/lib/terminal-shop/request_options.rb +4 -11
  14. data/lib/terminal-shop/resources/address.rb +0 -5
  15. data/lib/terminal-shop/resources/app.rb +0 -5
  16. data/lib/terminal-shop/resources/card.rb +0 -6
  17. data/lib/terminal-shop/resources/cart.rb +0 -7
  18. data/lib/terminal-shop/resources/email.rb +0 -2
  19. data/lib/terminal-shop/resources/order.rb +0 -4
  20. data/lib/terminal-shop/resources/product.rb +0 -3
  21. data/lib/terminal-shop/resources/profile.rb +0 -3
  22. data/lib/terminal-shop/resources/subscription.rb +0 -5
  23. data/lib/terminal-shop/resources/token.rb +0 -5
  24. data/lib/terminal-shop/resources/view.rb +0 -2
  25. data/lib/terminal-shop/util.rb +44 -71
  26. data/lib/terminal-shop/version.rb +1 -1
  27. data/lib/terminal-shop.rb +2 -0
  28. data/manifest.yaml +1 -0
  29. data/rbi/lib/terminal-shop/base_client.rbi +23 -0
  30. data/rbi/lib/terminal-shop/base_model.rbi +178 -52
  31. data/rbi/lib/terminal-shop/base_page.rbi +1 -2
  32. data/rbi/lib/terminal-shop/client.rbi +11 -0
  33. data/rbi/lib/terminal-shop/errors.rbi +33 -0
  34. data/rbi/lib/terminal-shop/extern.rbi +1 -1
  35. data/rbi/lib/terminal-shop/models/address.rbi +10 -0
  36. data/rbi/lib/terminal-shop/models/address_create_params.rbi +8 -0
  37. data/rbi/lib/terminal-shop/models/address_create_response.rbi +1 -0
  38. data/rbi/lib/terminal-shop/models/address_get_response.rbi +1 -0
  39. data/rbi/lib/terminal-shop/models/address_list_response.rbi +1 -0
  40. data/rbi/lib/terminal-shop/models/app.rbi +5 -0
  41. data/rbi/lib/terminal-shop/models/app_create_response.rbi +2 -0
  42. data/rbi/lib/terminal-shop/models/app_get_response.rbi +1 -0
  43. data/rbi/lib/terminal-shop/models/app_list_response.rbi +1 -0
  44. data/rbi/lib/terminal-shop/models/card.rbi +8 -0
  45. data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -0
  46. data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -0
  47. data/rbi/lib/terminal-shop/models/card_create_response.rbi +1 -0
  48. data/rbi/lib/terminal-shop/models/card_get_response.rbi +1 -0
  49. data/rbi/lib/terminal-shop/models/card_list_response.rbi +1 -0
  50. data/rbi/lib/terminal-shop/models/cart.rbi +19 -0
  51. data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +1 -0
  52. data/rbi/lib/terminal-shop/models/cart_get_response.rbi +1 -0
  53. data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +1 -0
  54. data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +1 -0
  55. data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -0
  56. data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +1 -0
  57. data/rbi/lib/terminal-shop/models/email_create_params.rbi +1 -0
  58. data/rbi/lib/terminal-shop/models/order.rbi +28 -0
  59. data/rbi/lib/terminal-shop/models/order_create_params.rbi +3 -0
  60. data/rbi/lib/terminal-shop/models/order_create_response.rbi +1 -0
  61. data/rbi/lib/terminal-shop/models/order_get_response.rbi +1 -0
  62. data/rbi/lib/terminal-shop/models/order_list_response.rbi +1 -0
  63. data/rbi/lib/terminal-shop/models/product.rbi +12 -6
  64. data/rbi/lib/terminal-shop/models/product_get_response.rbi +1 -0
  65. data/rbi/lib/terminal-shop/models/product_list_response.rbi +1 -0
  66. data/rbi/lib/terminal-shop/models/product_variant.rbi +4 -0
  67. data/rbi/lib/terminal-shop/models/profile.rbi +8 -0
  68. data/rbi/lib/terminal-shop/models/profile_me_response.rbi +1 -0
  69. data/rbi/lib/terminal-shop/models/profile_update_response.rbi +1 -0
  70. data/rbi/lib/terminal-shop/models/region.rbi +15 -0
  71. data/rbi/lib/terminal-shop/models/subscription.rbi +18 -11
  72. data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +1 -0
  73. data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +1 -0
  74. data/rbi/lib/terminal-shop/models/token.rbi +5 -0
  75. data/rbi/lib/terminal-shop/models/token_create_response.rbi +3 -0
  76. data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -0
  77. data/rbi/lib/terminal-shop/models/token_list_response.rbi +1 -0
  78. data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -13
  79. data/rbi/lib/terminal-shop/pooled_net_requester.rbi +10 -3
  80. data/rbi/lib/terminal-shop/request_options.rbi +21 -2
  81. data/rbi/lib/terminal-shop/resources/address.rbi +22 -2
  82. data/rbi/lib/terminal-shop/resources/app.rbi +14 -2
  83. data/rbi/lib/terminal-shop/resources/card.rbi +22 -3
  84. data/rbi/lib/terminal-shop/resources/cart.rbi +23 -3
  85. data/rbi/lib/terminal-shop/resources/email.rbi +6 -1
  86. data/rbi/lib/terminal-shop/resources/order.rbi +17 -2
  87. data/rbi/lib/terminal-shop/resources/product.rbi +7 -1
  88. data/rbi/lib/terminal-shop/resources/profile.rbi +2 -0
  89. data/rbi/lib/terminal-shop/resources/subscription.rbi +21 -2
  90. data/rbi/lib/terminal-shop/resources/token.rbi +14 -2
  91. data/rbi/lib/terminal-shop/resources/view.rbi +2 -0
  92. data/rbi/lib/terminal-shop/util.rbi +55 -8
  93. data/rbi/lib/terminal-shop/version.rbi +1 -1
  94. data/sig/terminal-shop/base_client.rbs +6 -1
  95. data/sig/terminal-shop/base_model.rbs +8 -6
  96. data/sig/terminal-shop/errors.rbs +4 -4
  97. data/sig/terminal-shop/models/region.rbs +12 -0
  98. data/sig/terminal-shop/models/subscription.rbs +1 -1
  99. data/sig/terminal-shop/models/view_init_response.rbs +3 -12
  100. data/sig/terminal-shop/pooled_net_requester.rbs +7 -2
  101. data/sig/terminal-shop/util.rbs +4 -4
  102. data/sig/terminal-shop/version.rbs +1 -1
  103. metadata +7 -4
@@ -1,10 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- # @private
5
- #
6
- # @abstract
7
- #
8
4
  # @example
9
5
  # ```ruby
10
6
  # if page.has_next?
@@ -21,40 +17,44 @@ module TerminalShop
21
17
  #
22
18
  # @example
23
19
  # ```ruby
24
- # products = page.to_enum.take(2)
20
+ # products = page
21
+ # .to_enum
22
+ # .lazy
23
+ # .select { _1.object_id.even? }
24
+ # .map(&:itself)
25
+ # .take(2)
26
+ # .to_a
25
27
  #
26
28
  # products => Array
27
29
  # ```
28
30
  module BasePage
29
31
  # @return [Boolean]
30
- #
31
32
  def next_page? = (raise NotImplementedError)
32
33
 
33
34
  # @raise [TerminalShop::APIError]
34
35
  # @return [TerminalShop::BasePage]
35
- #
36
36
  def next_page = (raise NotImplementedError)
37
37
 
38
38
  # @param blk [Proc]
39
39
  #
40
40
  # @return [void]
41
- #
42
41
  def auto_paging_each(&) = (raise NotImplementedError)
43
42
 
44
43
  # @return [Enumerable]
45
- #
46
44
  def to_enum = super(:auto_paging_each)
47
45
 
48
46
  alias_method :enum_for, :to_enum
49
47
 
50
- # @!parse
51
- # # @private
52
- # #
53
- # # @param client [TerminalShop::BaseClient]
54
- # # @param req [Hash{Symbol=>Object}]
55
- # # @param headers [Hash{String=>String}, Net::HTTPHeader]
56
- # # @param page_data [Object]
57
- # #
58
- # def initialize(client:, req:, headers:, page_data:); end
48
+ # @api private
49
+ #
50
+ # @param client [TerminalShop::BaseClient]
51
+ # @param req [Hash{Symbol=>Object}]
52
+ # @param headers [Hash{String=>String}, Net::HTTPHeader]
53
+ # @param page_data [Object]
54
+ def initialize(client:, req:, headers:, page_data:)
55
+ @client = client
56
+ @req = req
57
+ super()
58
+ end
59
59
  end
60
60
  end
@@ -58,10 +58,9 @@ module TerminalShop
58
58
  # @return [TerminalShop::Resources::View]
59
59
  attr_reader :view
60
60
 
61
- # @private
61
+ # @api private
62
62
  #
63
63
  # @return [Hash{String=>String}]
64
- #
65
64
  private def auth_headers
66
65
  return {} if @bearer_token.nil?
67
66
 
@@ -90,7 +89,6 @@ module TerminalShop
90
89
  # @param initial_retry_delay [Float]
91
90
  #
92
91
  # @param max_retry_delay [Float]
93
- #
94
92
  def initialize(
95
93
  environment: nil,
96
94
  base_url: nil,
@@ -4,7 +4,7 @@ module TerminalShop
4
4
  class Error < StandardError
5
5
  # @!parse
6
6
  # # @return [StandardError, nil]
7
- # attr_reader :cause
7
+ # attr_accessor :cause
8
8
  end
9
9
 
10
10
  class ConversionError < TerminalShop::Error
@@ -12,15 +12,15 @@ module TerminalShop
12
12
 
13
13
  class APIError < TerminalShop::Error
14
14
  # @return [URI::Generic]
15
- attr_reader :url
15
+ attr_accessor :url
16
16
 
17
17
  # @return [Integer, nil]
18
- attr_reader :status
18
+ attr_accessor :status
19
19
 
20
20
  # @return [Object, nil]
21
- attr_reader :body
21
+ attr_accessor :body
22
22
 
23
- # @private
23
+ # @api private
24
24
  #
25
25
  # @param url [URI::Generic]
26
26
  # @param status [Integer, nil]
@@ -28,7 +28,6 @@ module TerminalShop
28
28
  # @param request [nil]
29
29
  # @param response [nil]
30
30
  # @param message [String, nil]
31
- #
32
31
  def initialize(url:, status: nil, body: nil, request: nil, response: nil, message: nil)
33
32
  @url = url
34
33
  @status = status
@@ -42,13 +41,13 @@ module TerminalShop
42
41
  class APIConnectionError < TerminalShop::APIError
43
42
  # @!parse
44
43
  # # @return [nil]
45
- # attr_reader :status
44
+ # attr_accessor :status
46
45
 
47
46
  # @!parse
48
47
  # # @return [nil]
49
- # attr_reader :body
48
+ # attr_accessor :body
50
49
 
51
- # @private
50
+ # @api private
52
51
  #
53
52
  # @param url [URI::Generic]
54
53
  # @param status [nil]
@@ -56,7 +55,6 @@ module TerminalShop
56
55
  # @param request [nil]
57
56
  # @param response [nil]
58
57
  # @param message [String, nil]
59
- #
60
58
  def initialize(
61
59
  url:,
62
60
  status: nil,
@@ -70,7 +68,7 @@ module TerminalShop
70
68
  end
71
69
 
72
70
  class APITimeoutError < TerminalShop::APIConnectionError
73
- # @private
71
+ # @api private
74
72
  #
75
73
  # @param url [URI::Generic]
76
74
  # @param status [nil]
@@ -78,7 +76,6 @@ module TerminalShop
78
76
  # @param request [nil]
79
77
  # @param response [nil]
80
78
  # @param message [String, nil]
81
- #
82
79
  def initialize(
83
80
  url:,
84
81
  status: nil,
@@ -92,7 +89,7 @@ module TerminalShop
92
89
  end
93
90
 
94
91
  class APIStatusError < TerminalShop::APIError
95
- # @private
92
+ # @api private
96
93
  #
97
94
  # @param url [URI::Generic]
98
95
  # @param status [Integer]
@@ -102,7 +99,6 @@ module TerminalShop
102
99
  # @param message [String, nil]
103
100
  #
104
101
  # @return [TerminalShop::APIStatusError]
105
- #
106
102
  def self.for(url:, status:, body:, request:, response:, message: nil)
107
103
  kwargs = {url: url, status: status, body: body, request: request, response: response, message: message}
108
104
 
@@ -130,9 +126,9 @@ module TerminalShop
130
126
 
131
127
  # @!parse
132
128
  # # @return [Integer]
133
- # attr_reader :status
129
+ # attr_accessor :status
134
130
 
135
- # @private
131
+ # @api private
136
132
  #
137
133
  # @param url [URI::Generic]
138
134
  # @param status [Integer]
@@ -140,7 +136,6 @@ module TerminalShop
140
136
  # @param request [nil]
141
137
  # @param response [nil]
142
138
  # @param message [String, nil]
143
- #
144
139
  def initialize(url:, status:, body:, request:, response:, message: nil)
145
140
  message ||= {url: url.to_s, status: status, body: body}
146
141
  super(
@@ -1,10 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- # @private
5
- #
6
- # @abstract
7
- #
4
+ # @api private
8
5
  module Extern
9
6
  end
10
7
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ # @abstract
6
+ #
7
+ # A Terminal shop user's region.
8
+ class Region < TerminalShop::Enum
9
+ EU = :eu
10
+ NA = :na
11
+
12
+ finalize!
13
+ end
14
+ end
15
+ end
@@ -109,6 +109,12 @@ module TerminalShop
109
109
 
110
110
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
111
111
  end
112
+
113
+ # @!parse
114
+ # class << self
115
+ # # @return [Array(TerminalShop::Models::SubscriptionAPI::Schedule::Fixed, TerminalShop::Models::SubscriptionAPI::Schedule::Weekly)]
116
+ # def variants; end
117
+ # end
112
118
  end
113
119
  end
114
120
  end
@@ -57,8 +57,8 @@ module TerminalShop
57
57
  # @!attribute region
58
58
  # A Terminal shop user's region.
59
59
  #
60
- # @return [Symbol, TerminalShop::Models::ViewInitResponse::Data::Region]
61
- required :region, enum: -> { TerminalShop::Models::ViewInitResponse::Data::Region }
60
+ # @return [Symbol, TerminalShop::Models::Region]
61
+ required :region, enum: -> { TerminalShop::Models::Region }
62
62
 
63
63
  # @!attribute subscriptions
64
64
  #
@@ -80,23 +80,13 @@ module TerminalShop
80
80
  # # @param orders [Array<TerminalShop::Models::OrderAPI>]
81
81
  # # @param products [Array<TerminalShop::Models::ProductAPI>]
82
82
  # # @param profile [TerminalShop::Models::ProfileAPI]
83
- # # @param region [Symbol, TerminalShop::Models::ViewInitResponse::Data::Region]
83
+ # # @param region [Symbol, TerminalShop::Models::Region]
84
84
  # # @param subscriptions [Array<TerminalShop::Models::SubscriptionAPI>]
85
85
  # # @param tokens [Array<TerminalShop::Models::TokenAPI>]
86
86
  # #
87
87
  # def initialize(addresses:, apps:, cards:, cart:, orders:, products:, profile:, region:, subscriptions:, tokens:, **) = super
88
88
 
89
89
  # def initialize: (Hash | TerminalShop::BaseModel) -> void
90
-
91
- # @abstract
92
- #
93
- # A Terminal shop user's region.
94
- class Region < TerminalShop::Enum
95
- EU = :eu
96
- NA = :na
97
-
98
- finalize!
99
- end
100
90
  end
101
91
  end
102
92
  end
@@ -1,16 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- # @private
5
- #
4
+ # @api private
6
5
  class PooledNetRequester
7
6
  class << self
8
- # @private
7
+ # @api private
9
8
  #
10
9
  # @param url [URI::Generic]
11
10
  #
12
11
  # @return [Net::HTTP]
13
- #
14
12
  def connect(url)
15
13
  port =
16
14
  case [url.port, url.scheme]
@@ -28,17 +26,16 @@ module TerminalShop
28
26
  end
29
27
  end
30
28
 
31
- # @private
29
+ # @api private
32
30
  #
33
31
  # @param conn [Net::HTTP]
34
32
  # @param deadline [Float]
35
- #
36
33
  def calibrate_socket_timeout(conn, deadline)
37
34
  timeout = deadline - TerminalShop::Util.monotonic_secs
38
35
  conn.open_timeout = conn.read_timeout = conn.write_timeout = conn.continue_timeout = timeout
39
36
  end
40
37
 
41
- # @private
38
+ # @api private
42
39
  #
43
40
  # @param request [Hash{Symbol=>Object}] .
44
41
  #
@@ -51,7 +48,6 @@ module TerminalShop
51
48
  # @param blk [Proc]
52
49
  #
53
50
  # @return [Net::HTTPGenericRequest]
54
- #
55
51
  def build_request(request, &)
56
52
  method, url, headers, body = request.fetch_values(:method, :url, :headers, :body)
57
53
  req = Net::HTTPGenericRequest.new(
@@ -65,6 +61,7 @@ module TerminalShop
65
61
 
66
62
  case body
67
63
  in nil
64
+ nil
68
65
  in String
69
66
  req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
70
67
  req.body_stream = TerminalShop::Util::ReadIOAdapter.new(body, &)
@@ -80,13 +77,14 @@ module TerminalShop
80
77
  end
81
78
  end
82
79
 
83
- # @private
80
+ # @api private
84
81
  #
85
82
  # @param url [URI::Generic]
83
+ # @param deadline [Float]
86
84
  # @param blk [Proc]
87
- #
88
- private def with_pool(url, &)
85
+ private def with_pool(url, deadline:, &blk)
89
86
  origin = TerminalShop::Util.uri_origin(url)
87
+ timeout = deadline - TerminalShop::Util.monotonic_secs
90
88
  pool =
91
89
  @mutex.synchronize do
92
90
  @pools[origin] ||= ConnectionPool.new(size: @size) do
@@ -94,10 +92,10 @@ module TerminalShop
94
92
  end
95
93
  end
96
94
 
97
- pool.with(&)
95
+ pool.with(timeout: timeout, &blk)
98
96
  end
99
97
 
100
- # @private
98
+ # @api private
101
99
  #
102
100
  # @param request [Hash{Symbol=>Object}] .
103
101
  #
@@ -111,15 +109,14 @@ module TerminalShop
111
109
  #
112
110
  # @option request [Float] :deadline
113
111
  #
114
- # @return [Array(Net::HTTPResponse, Enumerable)]
115
- #
112
+ # @return [Array(Integer, Net::HTTPResponse, Enumerable)]
116
113
  def execute(request)
117
114
  url, deadline = request.fetch_values(:url, :deadline)
118
115
 
119
116
  eof = false
120
117
  finished = false
121
118
  enum = Enumerator.new do |y|
122
- with_pool(url) do |conn|
119
+ with_pool(url, deadline: deadline) do |conn|
123
120
  next if finished
124
121
 
125
122
  req = self.class.build_request(request) do
@@ -131,7 +128,7 @@ module TerminalShop
131
128
 
132
129
  self.class.calibrate_socket_timeout(conn, deadline)
133
130
  conn.request(req) do |rsp|
134
- y << [conn, rsp]
131
+ y << [conn, req, rsp]
135
132
  break if finished
136
133
 
137
134
  rsp.read_body do |bytes|
@@ -143,9 +140,11 @@ module TerminalShop
143
140
  eof = true
144
141
  end
145
142
  end
143
+ rescue Timeout::Error
144
+ raise TerminalShop::APITimeoutError
146
145
  end
147
146
 
148
- conn, response = enum.next
147
+ conn, _, response = enum.next
149
148
  body = TerminalShop::Util.fused_enum(enum, external: true) do
150
149
  finished = true
151
150
  tap do
@@ -155,13 +154,12 @@ module TerminalShop
155
154
  end
156
155
  conn.finish if !eof && conn&.started?
157
156
  end
158
- [response, (response.body = body)]
157
+ [Integer(response.code), response, (response.body = body)]
159
158
  end
160
159
 
161
- # @private
160
+ # @api private
162
161
  #
163
162
  # @param size [Integer]
164
- #
165
163
  def initialize(size: Etc.nprocessors)
166
164
  @mutex = Mutex.new
167
165
  @size = size
@@ -1,10 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- # @private
5
- #
6
- # @abstract
7
- #
4
+ # @api private
8
5
  module RequestParameters
9
6
  # @!parse
10
7
  # # Options to specify HTTP behaviour for this request.
@@ -12,7 +9,6 @@ module TerminalShop
12
9
  # attr_accessor :request_options
13
10
 
14
11
  # @param mod [Module]
15
- #
16
12
  def self.included(mod)
17
13
  return unless mod <= TerminalShop::BaseModel
18
14
 
@@ -20,15 +16,13 @@ module TerminalShop
20
16
  mod.optional(:request_options, TerminalShop::RequestOptions)
21
17
  end
22
18
 
23
- # @private
24
- #
19
+ # @api private
25
20
  module Converter
26
- # @private
21
+ # @api private
27
22
  #
28
23
  # @param params [Object]
29
24
  #
30
25
  # @return [Array(Object, Hash{Symbol=>Object})]
31
- #
32
26
  def dump_request(params)
33
27
  case (dumped = dump(params))
34
28
  in Hash
@@ -46,12 +40,11 @@ module TerminalShop
46
40
  # When making a request, you can pass an actual {RequestOptions} instance, or
47
41
  # simply pass a Hash with symbol keys matching the attributes on this class.
48
42
  class RequestOptions < TerminalShop::BaseModel
49
- # @private
43
+ # @api private
50
44
  #
51
45
  # @param opts [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
52
46
  #
53
47
  # @raise [ArgumentError]
54
- #
55
48
  def self.validate!(opts)
56
49
  case opts
57
50
  in TerminalShop::RequestOptions | Hash
@@ -26,7 +26,6 @@ module TerminalShop
26
26
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
27
27
  #
28
28
  # @return [TerminalShop::Models::AddressCreateResponse]
29
- #
30
29
  def create(params)
31
30
  parsed, options = TerminalShop::Models::AddressCreateParams.dump_request(params)
32
31
  @client.request(
@@ -45,7 +44,6 @@ module TerminalShop
45
44
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
46
45
  #
47
46
  # @return [TerminalShop::Models::AddressListResponse]
48
- #
49
47
  def list(params = {})
50
48
  @client.request(
51
49
  method: :get,
@@ -64,7 +62,6 @@ module TerminalShop
64
62
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
65
63
  #
66
64
  # @return [TerminalShop::Models::AddressDeleteResponse]
67
- #
68
65
  def delete(id, params = {})
69
66
  @client.request(
70
67
  method: :delete,
@@ -83,7 +80,6 @@ module TerminalShop
83
80
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
84
81
  #
85
82
  # @return [TerminalShop::Models::AddressGetResponse]
86
- #
87
83
  def get(id, params = {})
88
84
  @client.request(
89
85
  method: :get,
@@ -94,7 +90,6 @@ module TerminalShop
94
90
  end
95
91
 
96
92
  # @param client [TerminalShop::Client]
97
- #
98
93
  def initialize(client:)
99
94
  @client = client
100
95
  end
@@ -14,7 +14,6 @@ module TerminalShop
14
14
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
15
15
  #
16
16
  # @return [TerminalShop::Models::AppCreateResponse]
17
- #
18
17
  def create(params)
19
18
  parsed, options = TerminalShop::Models::AppCreateParams.dump_request(params)
20
19
  @client.request(
@@ -33,7 +32,6 @@ module TerminalShop
33
32
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
34
33
  #
35
34
  # @return [TerminalShop::Models::AppListResponse]
36
- #
37
35
  def list(params = {})
38
36
  @client.request(
39
37
  method: :get,
@@ -52,7 +50,6 @@ module TerminalShop
52
50
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
53
51
  #
54
52
  # @return [TerminalShop::Models::AppDeleteResponse]
55
- #
56
53
  def delete(id, params = {})
57
54
  @client.request(
58
55
  method: :delete,
@@ -71,7 +68,6 @@ module TerminalShop
71
68
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
72
69
  #
73
70
  # @return [TerminalShop::Models::AppGetResponse]
74
- #
75
71
  def get(id, params = {})
76
72
  @client.request(
77
73
  method: :get,
@@ -82,7 +78,6 @@ module TerminalShop
82
78
  end
83
79
 
84
80
  # @param client [TerminalShop::Client]
85
- #
86
81
  def initialize(client:)
87
82
  @client = client
88
83
  end
@@ -13,7 +13,6 @@ module TerminalShop
13
13
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
14
14
  #
15
15
  # @return [TerminalShop::Models::CardCreateResponse]
16
- #
17
16
  def create(params)
18
17
  parsed, options = TerminalShop::Models::CardCreateParams.dump_request(params)
19
18
  @client.request(
@@ -32,7 +31,6 @@ module TerminalShop
32
31
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
33
32
  #
34
33
  # @return [TerminalShop::Models::CardListResponse]
35
- #
36
34
  def list(params = {})
37
35
  @client.request(
38
36
  method: :get,
@@ -51,7 +49,6 @@ module TerminalShop
51
49
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
52
50
  #
53
51
  # @return [TerminalShop::Models::CardDeleteResponse]
54
- #
55
52
  def delete(id, params = {})
56
53
  @client.request(
57
54
  method: :delete,
@@ -69,7 +66,6 @@ module TerminalShop
69
66
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
70
67
  #
71
68
  # @return [TerminalShop::Models::CardCollectResponse]
72
- #
73
69
  def collect(params = {})
74
70
  @client.request(
75
71
  method: :post,
@@ -88,7 +84,6 @@ module TerminalShop
88
84
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
89
85
  #
90
86
  # @return [TerminalShop::Models::CardGetResponse]
91
- #
92
87
  def get(id, params = {})
93
88
  @client.request(
94
89
  method: :get,
@@ -99,7 +94,6 @@ module TerminalShop
99
94
  end
100
95
 
101
96
  # @param client [TerminalShop::Client]
102
- #
103
97
  def initialize(client:)
104
98
  @client = client
105
99
  end
@@ -10,7 +10,6 @@ module TerminalShop
10
10
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
11
11
  #
12
12
  # @return [TerminalShop::Models::CartClearResponse]
13
- #
14
13
  def clear(params = {})
15
14
  @client.request(
16
15
  method: :delete,
@@ -27,7 +26,6 @@ module TerminalShop
27
26
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
28
27
  #
29
28
  # @return [TerminalShop::Models::CartConvertResponse]
30
- #
31
29
  def convert(params = {})
32
30
  @client.request(
33
31
  method: :post,
@@ -44,7 +42,6 @@ module TerminalShop
44
42
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
45
43
  #
46
44
  # @return [TerminalShop::Models::CartGetResponse]
47
- #
48
45
  def get(params = {})
49
46
  @client.request(
50
47
  method: :get,
@@ -63,7 +60,6 @@ module TerminalShop
63
60
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
64
61
  #
65
62
  # @return [TerminalShop::Models::CartSetAddressResponse]
66
- #
67
63
  def set_address(params)
68
64
  parsed, options = TerminalShop::Models::CartSetAddressParams.dump_request(params)
69
65
  @client.request(
@@ -84,7 +80,6 @@ module TerminalShop
84
80
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
85
81
  #
86
82
  # @return [TerminalShop::Models::CartSetCardResponse]
87
- #
88
83
  def set_card(params)
89
84
  parsed, options = TerminalShop::Models::CartSetCardParams.dump_request(params)
90
85
  @client.request(
@@ -107,7 +102,6 @@ module TerminalShop
107
102
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
108
103
  #
109
104
  # @return [TerminalShop::Models::CartSetItemResponse]
110
- #
111
105
  def set_item(params)
112
106
  parsed, options = TerminalShop::Models::CartSetItemParams.dump_request(params)
113
107
  @client.request(
@@ -120,7 +114,6 @@ module TerminalShop
120
114
  end
121
115
 
122
116
  # @param client [TerminalShop::Client]
123
- #
124
117
  def initialize(client:)
125
118
  @client = client
126
119
  end
@@ -12,7 +12,6 @@ module TerminalShop
12
12
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
13
13
  #
14
14
  # @return [TerminalShop::Models::EmailCreateResponse]
15
- #
16
15
  def create(params)
17
16
  parsed, options = TerminalShop::Models::EmailCreateParams.dump_request(params)
18
17
  @client.request(
@@ -25,7 +24,6 @@ module TerminalShop
25
24
  end
26
25
 
27
26
  # @param client [TerminalShop::Client]
28
- #
29
27
  def initialize(client:)
30
28
  @client = client
31
29
  end