terminal-shop 1.5.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 +4 -4
- data/lib/terminal-shop/base_model.rb +25 -0
- data/lib/terminal-shop/models/region.rb +15 -0
- data/lib/terminal-shop/models/view_init_response.rb +4 -12
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +1 -0
- data/rbi/lib/terminal-shop/models/region.rbi +18 -0
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +0 -13
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/models/region.rbs +12 -0
- data/sig/terminal-shop/models/view_init_response.rbs +3 -12
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +4 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66d749e7fcafbb6c6cb6edd0f9d3e380a207c09940b8c05617d2699005baa37e
|
4
|
+
data.tar.gz: a8e5b3220f034724bc107d7271675d004dd56ee604f79d2fa867c9f896602925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
@@ -55,9 +55,10 @@ module TerminalShop
|
|
55
55
|
required :profile, -> { TerminalShop::Models::ProfileAPI }
|
56
56
|
|
57
57
|
# @!attribute region
|
58
|
+
# A Terminal shop user's region.
|
58
59
|
#
|
59
|
-
# @return [Symbol, TerminalShop::Models::
|
60
|
-
required :region, enum: -> { TerminalShop::Models::
|
60
|
+
# @return [Symbol, TerminalShop::Models::Region]
|
61
|
+
required :region, enum: -> { TerminalShop::Models::Region }
|
61
62
|
|
62
63
|
# @!attribute subscriptions
|
63
64
|
#
|
@@ -79,22 +80,13 @@ module TerminalShop
|
|
79
80
|
# # @param orders [Array<TerminalShop::Models::OrderAPI>]
|
80
81
|
# # @param products [Array<TerminalShop::Models::ProductAPI>]
|
81
82
|
# # @param profile [TerminalShop::Models::ProfileAPI]
|
82
|
-
# # @param region [Symbol, TerminalShop::Models::
|
83
|
+
# # @param region [Symbol, TerminalShop::Models::Region]
|
83
84
|
# # @param subscriptions [Array<TerminalShop::Models::SubscriptionAPI>]
|
84
85
|
# # @param tokens [Array<TerminalShop::Models::TokenAPI>]
|
85
86
|
# #
|
86
87
|
# def initialize(addresses:, apps:, cards:, cart:, orders:, products:, profile:, region:, subscriptions:, tokens:, **) = super
|
87
88
|
|
88
89
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
89
|
-
|
90
|
-
# @abstract
|
91
|
-
#
|
92
|
-
class Region < TerminalShop::Enum
|
93
|
-
NA = :na
|
94
|
-
EU = :eu
|
95
|
-
|
96
|
-
finalize!
|
97
|
-
end
|
98
90
|
end
|
99
91
|
end
|
100
92
|
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"
|
@@ -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
|
-
NA = :na
|
151
|
-
EU = :eu
|
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
|
@@ -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::
|
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::
|
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::
|
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 = :na | :eu
|
74
|
-
|
75
|
-
class Region < TerminalShop::Enum
|
76
|
-
NA: :na
|
77
|
-
EU: :eu
|
78
|
-
|
79
|
-
def self.values: -> ::Array[TerminalShop::Models::ViewInitResponse::Data::region]
|
80
|
-
end
|
81
72
|
end
|
82
73
|
end
|
83
74
|
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.
|
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
|