terminal-shop 1.6.0 → 1.7.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: d27c9b969e5f710ddd5ec412d957b321c294ef271556e868cbcdd6bd7b294d50
4
- data.tar.gz: 218d19b29f7565febb370d1637548988b7ead29a5fb9d95d6626b7289f8aba43
3
+ metadata.gz: 66d749e7fcafbb6c6cb6edd0f9d3e380a207c09940b8c05617d2699005baa37e
4
+ data.tar.gz: a8e5b3220f034724bc107d7271675d004dd56ee604f79d2fa867c9f896602925
5
5
  SHA512:
6
- metadata.gz: ae88083b381eafbe8668224bfa390bfa003f5156d024a0021266608a446989fe0927200b72e6698d34cd3babcb6c9d6a4c03a5d56ca02374a3adb054d8fae486
7
- data.tar.gz: 4e23af5ad9f4360516ef5e46a8adb635048eec1b201bb90dc7e51933e72c1a3873d66febe5287fe755a497010298053bf888ee992a1914068f5f4c57673597d5
6
+ metadata.gz: f15b618ed726ffdac155669ed4b39a752b85296e3c06512c2ff058aec200e5aa5801c2264107cdf52523c66503386e4cb400f40fa1316394bef2a4e4a3ea1392
7
+ data.tar.gz: 8e7c4abf3f9827f0ac18f40b5d31f725c963b81e92c70ffe8e1b252f33d49f293b84d3ca89bd305e395bae1ed1487ed268c3c4bc400ff14e274bb9786d0d37b1
@@ -312,6 +312,31 @@ module TerminalShop
312
312
  #
313
313
  # We can therefore convert string values to Symbols, but can't convert other
314
314
  # values safely.
315
+ #
316
+ # @example
317
+ # ```ruby
318
+ # # `region` is a `TerminalShop::Models::Region`
319
+ # case region
320
+ # when TerminalShop::Models::Region::EU
321
+ # # ...
322
+ # when TerminalShop::Models::Region::NA
323
+ # # ...
324
+ # else
325
+ # # ...
326
+ # end
327
+ # ```
328
+ #
329
+ # @example
330
+ # ```ruby
331
+ # case region
332
+ # in :eu
333
+ # # ...
334
+ # in :na
335
+ # # ...
336
+ # else
337
+ # # ...
338
+ # end
339
+ # ```
315
340
  class Enum
316
341
  extend TerminalShop::Converter
317
342
 
@@ -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
@@ -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,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- VERSION = "1.6.0"
4
+ VERSION = "1.7.0"
5
5
  end
data/lib/terminal-shop.rb CHANGED
@@ -91,6 +91,7 @@ require_relative "terminal-shop/models/profile_me_params"
91
91
  require_relative "terminal-shop/models/profile_me_response"
92
92
  require_relative "terminal-shop/models/profile_update_params"
93
93
  require_relative "terminal-shop/models/profile_update_response"
94
+ require_relative "terminal-shop/models/region"
94
95
  require_relative "terminal-shop/models/subscription_create_params"
95
96
  require_relative "terminal-shop/models/subscription_create_response"
96
97
  require_relative "terminal-shop/models/subscription_delete_params"
@@ -0,0 +1,18 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class Region < TerminalShop::Enum
6
+ abstract!
7
+
8
+ EU = :eu
9
+ NA = :na
10
+
11
+ class << self
12
+ sig { override.returns(T::Array[Symbol]) }
13
+ def values
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -143,19 +143,6 @@ module TerminalShop
143
143
  end
144
144
  def to_hash
145
145
  end
146
-
147
- class Region < TerminalShop::Enum
148
- abstract!
149
-
150
- EU = :eu
151
- NA = :na
152
-
153
- class << self
154
- sig { override.returns(T::Array[Symbol]) }
155
- def values
156
- end
157
- end
158
- end
159
146
  end
160
147
  end
161
148
  end
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module TerminalShop
4
- VERSION = "1.6.0"
4
+ VERSION = "1.7.0"
5
5
  end
@@ -0,0 +1,12 @@
1
+ module TerminalShop
2
+ module Models
3
+ type region = :eu | :na
4
+
5
+ class Region < TerminalShop::Enum
6
+ EU: :eu
7
+ NA: :na
8
+
9
+ def self.values: -> ::Array[TerminalShop::Models::region]
10
+ end
11
+ end
12
+ end
@@ -24,7 +24,7 @@ module TerminalShop
24
24
  orders: ::Array[TerminalShop::Models::OrderAPI],
25
25
  products: ::Array[TerminalShop::Models::ProductAPI],
26
26
  profile: TerminalShop::Models::ProfileAPI,
27
- region: TerminalShop::Models::ViewInitResponse::Data::region,
27
+ region: TerminalShop::Models::region,
28
28
  subscriptions: ::Array[TerminalShop::Models::SubscriptionAPI],
29
29
  tokens: ::Array[TerminalShop::Models::TokenAPI]
30
30
  }
@@ -44,7 +44,7 @@ module TerminalShop
44
44
 
45
45
  attr_accessor profile: TerminalShop::Models::ProfileAPI
46
46
 
47
- attr_accessor region: TerminalShop::Models::ViewInitResponse::Data::region
47
+ attr_accessor region: TerminalShop::Models::region
48
48
 
49
49
  attr_accessor subscriptions: ::Array[TerminalShop::Models::SubscriptionAPI]
50
50
 
@@ -59,7 +59,7 @@ module TerminalShop
59
59
  orders: ::Array[TerminalShop::Models::OrderAPI],
60
60
  products: ::Array[TerminalShop::Models::ProductAPI],
61
61
  profile: TerminalShop::Models::ProfileAPI,
62
- region: TerminalShop::Models::ViewInitResponse::Data::region,
62
+ region: TerminalShop::Models::region,
63
63
  subscriptions: ::Array[TerminalShop::Models::SubscriptionAPI],
64
64
  tokens: ::Array[TerminalShop::Models::TokenAPI]
65
65
  ) -> void
@@ -69,15 +69,6 @@ module TerminalShop
69
69
  ) -> void
70
70
 
71
71
  def to_hash: -> TerminalShop::Models::ViewInitResponse::data
72
-
73
- type region = :eu | :na
74
-
75
- class Region < TerminalShop::Enum
76
- EU: :eu
77
- NA: :na
78
-
79
- def self.values: -> ::Array[TerminalShop::Models::ViewInitResponse::Data::region]
80
- end
81
72
  end
82
73
  end
83
74
  end
@@ -1,3 +1,3 @@
1
1
  module TerminalShop
2
- VERSION: "1.5.0"
2
+ VERSION: "1.6.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: terminal-shop
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terminal
@@ -101,6 +101,7 @@ files:
101
101
  - lib/terminal-shop/models/profile_me_response.rb
102
102
  - lib/terminal-shop/models/profile_update_params.rb
103
103
  - lib/terminal-shop/models/profile_update_response.rb
104
+ - lib/terminal-shop/models/region.rb
104
105
  - lib/terminal-shop/models/subscription.rb
105
106
  - lib/terminal-shop/models/subscription_create_params.rb
106
107
  - lib/terminal-shop/models/subscription_create_response.rb
@@ -205,6 +206,7 @@ files:
205
206
  - rbi/lib/terminal-shop/models/profile_me_response.rbi
206
207
  - rbi/lib/terminal-shop/models/profile_update_params.rbi
207
208
  - rbi/lib/terminal-shop/models/profile_update_response.rbi
209
+ - rbi/lib/terminal-shop/models/region.rbi
208
210
  - rbi/lib/terminal-shop/models/subscription.rbi
209
211
  - rbi/lib/terminal-shop/models/subscription_create_params.rbi
210
212
  - rbi/lib/terminal-shop/models/subscription_create_response.rbi
@@ -308,6 +310,7 @@ files:
308
310
  - sig/terminal-shop/models/profile_me_response.rbs
309
311
  - sig/terminal-shop/models/profile_update_params.rbs
310
312
  - sig/terminal-shop/models/profile_update_response.rbs
313
+ - sig/terminal-shop/models/region.rbs
311
314
  - sig/terminal-shop/models/subscription.rbs
312
315
  - sig/terminal-shop/models/subscription_create_params.rbs
313
316
  - sig/terminal-shop/models/subscription_create_response.rbs