terminal-shop 0.1.0.pre.alpha.15 → 1.1.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/README.md +27 -19
- data/lib/terminal-shop/base_client.rb +35 -55
- data/lib/terminal-shop/base_model.rb +457 -438
- data/lib/terminal-shop/base_page.rb +2 -2
- data/lib/terminal-shop/client.rb +1 -1
- data/lib/terminal-shop/errors.rb +3 -2
- data/lib/terminal-shop/models/address_get_params.rb +18 -0
- data/lib/terminal-shop/models/address_get_response.rb +20 -0
- data/lib/terminal-shop/models/app_create_params.rb +14 -2
- data/lib/terminal-shop/models/card_get_params.rb +18 -0
- data/lib/terminal-shop/models/card_get_response.rb +20 -0
- data/lib/terminal-shop/models/cart.rb +35 -2
- data/lib/terminal-shop/models/cart_convert_params.rb +11 -1
- data/lib/terminal-shop/models/cart_redeem_gift_card_params.rb +24 -0
- data/lib/terminal-shop/models/cart_redeem_gift_card_response.rb +48 -0
- data/lib/terminal-shop/models/cart_remove_gift_card_params.rb +18 -0
- data/lib/terminal-shop/models/cart_remove_gift_card_response.rb +19 -0
- data/lib/terminal-shop/models/product.rb +72 -46
- data/lib/terminal-shop/models/product_get_params.rb +18 -0
- data/lib/terminal-shop/models/product_get_response.rb +20 -0
- data/lib/terminal-shop/models/profile_update_params.rb +7 -9
- data/lib/terminal-shop/models/subscription.rb +0 -10
- data/lib/terminal-shop/models/subscription_get_params.rb +18 -0
- data/lib/terminal-shop/models/subscription_get_response.rb +20 -0
- data/lib/terminal-shop/pooled_net_requester.rb +14 -9
- data/lib/terminal-shop/resources/address.rb +19 -0
- data/lib/terminal-shop/resources/app.rb +2 -6
- data/lib/terminal-shop/resources/card.rb +19 -0
- data/lib/terminal-shop/resources/cart.rb +43 -1
- data/lib/terminal-shop/resources/product.rb +19 -0
- data/lib/terminal-shop/resources/profile.rb +3 -3
- data/lib/terminal-shop/resources/subscription.rb +19 -0
- data/lib/terminal-shop/util.rb +135 -1
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +13 -1
- data/rbi/lib/terminal-shop/base_client.rbi +29 -35
- data/rbi/lib/terminal-shop/base_model.rbi +235 -217
- data/rbi/lib/terminal-shop/base_page.rbi +2 -2
- data/rbi/lib/terminal-shop/client.rbi +2 -2
- data/rbi/lib/terminal-shop/errors.rbi +11 -10
- data/rbi/lib/terminal-shop/models/address.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_create_params.rbi +3 -13
- data/rbi/lib/terminal-shop/models/address_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/address_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/address_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/address_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_create_params.rbi +29 -4
- data/rbi/lib/terminal-shop/models/app_create_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/app_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/app_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/app_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card.rbi +4 -4
- data/rbi/lib/terminal-shop/models/card_collect_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_collect_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/card_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/card_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/card_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/card_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart.rbi +45 -9
- data/rbi/lib/terminal-shop/models/cart_convert_params.rbi +17 -3
- data/rbi/lib/terminal-shop/models/cart_convert_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/cart_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_params.rbi +32 -0
- data/rbi/lib/terminal-shop/models/cart_redeem_gift_card_response.rbi +66 -0
- data/rbi/lib/terminal-shop/models/cart_remove_gift_card_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/cart_remove_gift_card_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/cart_set_address_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_address_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_card_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_card_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_item_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/cart_set_item_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/email_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/email_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order.rbi +10 -10
- data/rbi/lib/terminal-shop/models/order_create_params.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/order_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/order_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/order_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product.rbi +88 -27
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/product_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/product_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/product_variant.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile.rbi +4 -4
- data/rbi/lib/terminal-shop/models/profile_me_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/profile_me_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/profile_update_params.rbi +9 -14
- data/rbi/lib/terminal-shop/models/profile_update_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription.rbi +15 -13
- data/rbi/lib/terminal-shop/models/subscription_create_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_create_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +21 -0
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +23 -0
- data/rbi/lib/terminal-shop/models/subscription_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/subscription_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_create_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_create_response.rbi +4 -4
- data/rbi/lib/terminal-shop/models/token_delete_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_delete_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_get_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/token_list_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/token_list_response.rbi +2 -2
- data/rbi/lib/terminal-shop/models/view_init_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/view_init_response.rbi +5 -15
- data/rbi/lib/terminal-shop/pooled_net_requester.rbi +12 -10
- data/rbi/lib/terminal-shop/request_options.rbi +4 -0
- data/rbi/lib/terminal-shop/resources/address.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/app.rbi +3 -5
- data/rbi/lib/terminal-shop/resources/card.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/cart.rbi +24 -4
- data/rbi/lib/terminal-shop/resources/email.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/order.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/product.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/profile.rbi +5 -5
- data/rbi/lib/terminal-shop/resources/subscription.rbi +12 -2
- data/rbi/lib/terminal-shop/resources/token.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/view.rbi +2 -2
- data/rbi/lib/terminal-shop/util.rbi +153 -104
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- data/sig/terminal-shop/base_client.rbs +3 -7
- data/sig/terminal-shop/base_page.rbs +1 -1
- data/sig/terminal-shop/errors.rbs +2 -1
- data/sig/terminal-shop/models/address_get_params.rbs +19 -0
- data/sig/terminal-shop/models/address_get_response.rbs +18 -0
- data/sig/terminal-shop/models/app_create_params.rbs +12 -3
- data/sig/terminal-shop/models/card_get_params.rbs +18 -0
- data/sig/terminal-shop/models/card_get_response.rbs +18 -0
- data/sig/terminal-shop/models/cart.rbs +27 -2
- data/sig/terminal-shop/models/cart_convert_params.rbs +10 -2
- data/sig/terminal-shop/models/cart_redeem_gift_card_params.rbs +25 -0
- data/sig/terminal-shop/models/cart_redeem_gift_card_response.rbs +47 -0
- data/sig/terminal-shop/models/cart_remove_gift_card_params.rbs +19 -0
- data/sig/terminal-shop/models/cart_remove_gift_card_response.rbs +18 -0
- data/sig/terminal-shop/models/product.rbs +58 -17
- data/sig/terminal-shop/models/product_get_params.rbs +19 -0
- data/sig/terminal-shop/models/product_get_response.rbs +18 -0
- data/sig/terminal-shop/models/profile_update_params.rbs +5 -5
- data/sig/terminal-shop/models/subscription_get_params.rbs +19 -0
- data/sig/terminal-shop/models/subscription_get_response.rbs +19 -0
- data/sig/terminal-shop/request_options.rbs +4 -0
- data/sig/terminal-shop/resources/address.rbs +10 -0
- data/sig/terminal-shop/resources/app.rbs +0 -2
- data/sig/terminal-shop/resources/card.rbs +10 -0
- data/sig/terminal-shop/resources/cart.rbs +20 -0
- data/sig/terminal-shop/resources/product.rbs +10 -0
- data/sig/terminal-shop/resources/profile.rbs +3 -4
- data/sig/terminal-shop/resources/subscription.rbs +11 -0
- data/sig/terminal-shop/util.rbs +19 -0
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +40 -4
@@ -33,8 +33,8 @@ module TerminalShop
|
|
33
33
|
# # @param client [TerminalShop::BaseClient]
|
34
34
|
# # @param req [Hash{Symbol=>Object}]
|
35
35
|
# # @param headers [Hash{String=>String}, Net::HTTPHeader]
|
36
|
-
# # @param
|
36
|
+
# # @param page_data [Object]
|
37
37
|
# #
|
38
|
-
# def initialize(client:, req:, headers:,
|
38
|
+
# def initialize(client:, req:, headers:, page_data:); end
|
39
39
|
end
|
40
40
|
end
|
data/lib/terminal-shop/client.rb
CHANGED
@@ -65,7 +65,7 @@ module TerminalShop
|
|
65
65
|
private def auth_headers
|
66
66
|
return {} if @bearer_token.nil?
|
67
67
|
|
68
|
-
{"
|
68
|
+
{"authorization" => "Bearer #{@bearer_token}"}
|
69
69
|
end
|
70
70
|
|
71
71
|
# Creates and returns a new client for interacting with the API.
|
data/lib/terminal-shop/errors.rb
CHANGED
@@ -99,11 +99,12 @@ module TerminalShop
|
|
99
99
|
# @param body [Object, nil]
|
100
100
|
# @param request [nil]
|
101
101
|
# @param response [nil]
|
102
|
+
# @param message [String, nil]
|
102
103
|
#
|
103
104
|
# @return [TerminalShop::APIStatusError]
|
104
105
|
#
|
105
|
-
def self.for(url:, status:, body:, request:, response:)
|
106
|
-
kwargs = {url: url, status: status, body: body, request: request, response: response}
|
106
|
+
def self.for(url:, status:, body:, request:, response:, message: nil)
|
107
|
+
kwargs = {url: url, status: status, body: body, request: request, response: response, message: message}
|
107
108
|
|
108
109
|
case status
|
109
110
|
in 400
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class AddressGetParams < TerminalShop::BaseModel
|
6
|
+
# @!parse
|
7
|
+
# extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
# @!parse
|
11
|
+
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
# #
|
13
|
+
# def initialize(request_options: {}, **) = super
|
14
|
+
|
15
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class AddressGetResponse < TerminalShop::BaseModel
|
6
|
+
# @!attribute data
|
7
|
+
# Physical address associated with a Terminal shop user.
|
8
|
+
#
|
9
|
+
# @return [TerminalShop::Models::AddressAPI]
|
10
|
+
required :data, -> { TerminalShop::Models::AddressAPI }
|
11
|
+
|
12
|
+
# @!parse
|
13
|
+
# # @param data [TerminalShop::Models::AddressAPI]
|
14
|
+
# #
|
15
|
+
# def initialize(data:, **) = super
|
16
|
+
|
17
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -2,15 +2,27 @@
|
|
2
2
|
|
3
3
|
module TerminalShop
|
4
4
|
module Models
|
5
|
-
class AppCreateParams < TerminalShop::
|
5
|
+
class AppCreateParams < TerminalShop::BaseModel
|
6
6
|
# @!parse
|
7
7
|
# extend TerminalShop::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
|
+
# @!attribute name
|
11
|
+
#
|
12
|
+
# @return [String]
|
13
|
+
required :name, String
|
14
|
+
|
15
|
+
# @!attribute redirect_uri
|
16
|
+
#
|
17
|
+
# @return [String]
|
18
|
+
required :redirect_uri, String, api_name: :redirectURI
|
19
|
+
|
10
20
|
# @!parse
|
21
|
+
# # @param name [String]
|
22
|
+
# # @param redirect_uri [String]
|
11
23
|
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
24
|
# #
|
13
|
-
# def initialize(request_options: {}, **) = super
|
25
|
+
# def initialize(name:, redirect_uri:, request_options: {}, **) = super
|
14
26
|
|
15
27
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
28
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class CardGetParams < TerminalShop::BaseModel
|
6
|
+
# @!parse
|
7
|
+
# extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
# @!parse
|
11
|
+
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
# #
|
13
|
+
# def initialize(request_options: {}, **) = super
|
14
|
+
|
15
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class CardGetResponse < TerminalShop::BaseModel
|
6
|
+
# @!attribute data
|
7
|
+
# Credit card used for payments in the Terminal shop.
|
8
|
+
#
|
9
|
+
# @return [TerminalShop::Models::CardAPI]
|
10
|
+
required :data, -> { TerminalShop::Models::CardAPI }
|
11
|
+
|
12
|
+
# @!parse
|
13
|
+
# # @param data [TerminalShop::Models::CardAPI]
|
14
|
+
# #
|
15
|
+
# def initialize(data:, **) = super
|
16
|
+
|
17
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -41,6 +41,16 @@ module TerminalShop
|
|
41
41
|
# # @return [String]
|
42
42
|
# attr_writer :card_id
|
43
43
|
|
44
|
+
# @!attribute [r] gift_card_id
|
45
|
+
# ID of the gift card applied to the current user's cart.
|
46
|
+
#
|
47
|
+
# @return [String, nil]
|
48
|
+
optional :gift_card_id, String, api_name: :giftCardID
|
49
|
+
|
50
|
+
# @!parse
|
51
|
+
# # @return [String]
|
52
|
+
# attr_writer :gift_card_id
|
53
|
+
|
44
54
|
# @!attribute [r] shipping
|
45
55
|
# Shipping information for the current user's cart.
|
46
56
|
#
|
@@ -59,9 +69,10 @@ module TerminalShop
|
|
59
69
|
# # @param subtotal [Integer]
|
60
70
|
# # @param address_id [String]
|
61
71
|
# # @param card_id [String]
|
72
|
+
# # @param gift_card_id [String]
|
62
73
|
# # @param shipping [TerminalShop::Models::CartAPI::Shipping]
|
63
74
|
# #
|
64
|
-
# def initialize(amount:, items:, subtotal:, address_id: nil, card_id: nil, shipping: nil, **) = super
|
75
|
+
# def initialize(amount:, items:, subtotal:, address_id: nil, card_id: nil, gift_card_id: nil, shipping: nil, **) = super
|
65
76
|
|
66
77
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
67
78
|
|
@@ -72,6 +83,16 @@ module TerminalShop
|
|
72
83
|
# @return [Integer]
|
73
84
|
required :subtotal, Integer
|
74
85
|
|
86
|
+
# @!attribute [r] gift_card
|
87
|
+
# Amount applied from gift card on the current user's cart, in cents (USD).
|
88
|
+
#
|
89
|
+
# @return [Integer, nil]
|
90
|
+
optional :gift_card, Integer, api_name: :giftCard
|
91
|
+
|
92
|
+
# @!parse
|
93
|
+
# # @return [Integer]
|
94
|
+
# attr_writer :gift_card
|
95
|
+
|
75
96
|
# @!attribute [r] shipping
|
76
97
|
# Shipping amount of the current user's cart, in cents (USD).
|
77
98
|
#
|
@@ -82,13 +103,25 @@ module TerminalShop
|
|
82
103
|
# # @return [Integer]
|
83
104
|
# attr_writer :shipping
|
84
105
|
|
106
|
+
# @!attribute [r] total
|
107
|
+
# Total amount after gift card applied, in cents (USD).
|
108
|
+
#
|
109
|
+
# @return [Integer, nil]
|
110
|
+
optional :total, Integer
|
111
|
+
|
112
|
+
# @!parse
|
113
|
+
# # @return [Integer]
|
114
|
+
# attr_writer :total
|
115
|
+
|
85
116
|
# @!parse
|
86
117
|
# # The subtotal and shipping amounts for the current user's cart.
|
87
118
|
# #
|
88
119
|
# # @param subtotal [Integer]
|
120
|
+
# # @param gift_card [Integer]
|
89
121
|
# # @param shipping [Integer]
|
122
|
+
# # @param total [Integer]
|
90
123
|
# #
|
91
|
-
# def initialize(subtotal:, shipping: nil, **) = super
|
124
|
+
# def initialize(subtotal:, gift_card: nil, shipping: nil, total: nil, **) = super
|
92
125
|
|
93
126
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
94
127
|
end
|
@@ -7,10 +7,20 @@ module TerminalShop
|
|
7
7
|
# extend TerminalShop::RequestParameters::Converter
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
|
+
# @!attribute [r] recipient_email
|
11
|
+
#
|
12
|
+
# @return [String, nil]
|
13
|
+
optional :recipient_email, String, api_name: :recipientEmail
|
14
|
+
|
15
|
+
# @!parse
|
16
|
+
# # @return [String]
|
17
|
+
# attr_writer :recipient_email
|
18
|
+
|
10
19
|
# @!parse
|
20
|
+
# # @param recipient_email [String]
|
11
21
|
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
22
|
# #
|
13
|
-
# def initialize(request_options: {}, **) = super
|
23
|
+
# def initialize(recipient_email: nil, request_options: {}, **) = super
|
14
24
|
|
15
25
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
26
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class CartRedeemGiftCardParams < TerminalShop::BaseModel
|
6
|
+
# @!parse
|
7
|
+
# extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
# @!attribute gift_card_id
|
11
|
+
#
|
12
|
+
# @return [String]
|
13
|
+
required :gift_card_id, String, api_name: :giftCardID
|
14
|
+
|
15
|
+
# @!parse
|
16
|
+
# # @param gift_card_id [String]
|
17
|
+
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
18
|
+
# #
|
19
|
+
# def initialize(gift_card_id:, request_options: {}, **) = super
|
20
|
+
|
21
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class CartRedeemGiftCardResponse < TerminalShop::BaseModel
|
6
|
+
# @!attribute data
|
7
|
+
# Gift card redemption result
|
8
|
+
#
|
9
|
+
# @return [TerminalShop::Models::CartRedeemGiftCardResponse::Data]
|
10
|
+
required :data, -> { TerminalShop::Models::CartRedeemGiftCardResponse::Data }
|
11
|
+
|
12
|
+
# @!parse
|
13
|
+
# # @param data [TerminalShop::Models::CartRedeemGiftCardResponse::Data]
|
14
|
+
# #
|
15
|
+
# def initialize(data:, **) = super
|
16
|
+
|
17
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
18
|
+
|
19
|
+
class Data < TerminalShop::BaseModel
|
20
|
+
# @!attribute applied_amount
|
21
|
+
#
|
22
|
+
# @return [Integer]
|
23
|
+
required :applied_amount, Integer, api_name: :appliedAmount
|
24
|
+
|
25
|
+
# @!attribute gift_card_id
|
26
|
+
#
|
27
|
+
# @return [String]
|
28
|
+
required :gift_card_id, String, api_name: :giftCardID
|
29
|
+
|
30
|
+
# @!attribute remaining_balance
|
31
|
+
#
|
32
|
+
# @return [Integer]
|
33
|
+
required :remaining_balance, Integer, api_name: :remainingBalance
|
34
|
+
|
35
|
+
# @!parse
|
36
|
+
# # Gift card redemption result
|
37
|
+
# #
|
38
|
+
# # @param applied_amount [Integer]
|
39
|
+
# # @param gift_card_id [String]
|
40
|
+
# # @param remaining_balance [Integer]
|
41
|
+
# #
|
42
|
+
# def initialize(applied_amount:, gift_card_id:, remaining_balance:, **) = super
|
43
|
+
|
44
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class CartRemoveGiftCardParams < TerminalShop::BaseModel
|
6
|
+
# @!parse
|
7
|
+
# extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
# @!parse
|
11
|
+
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
# #
|
13
|
+
# def initialize(request_options: {}, **) = super
|
14
|
+
|
15
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class CartRemoveGiftCardResponse < TerminalShop::BaseModel
|
6
|
+
# @!attribute data
|
7
|
+
#
|
8
|
+
# @return [Symbol, :ok]
|
9
|
+
required :data, const: :ok
|
10
|
+
|
11
|
+
# @!parse
|
12
|
+
# # @param data [Symbol, :ok]
|
13
|
+
# #
|
14
|
+
# def initialize(data: :ok, **) = super
|
15
|
+
|
16
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -15,11 +15,6 @@ module TerminalShop
|
|
15
15
|
# @return [String]
|
16
16
|
required :description, String
|
17
17
|
|
18
|
-
# @!attribute filters
|
19
|
-
#
|
20
|
-
# @return [Array<Symbol, TerminalShop::Models::ProductAPI::Filter>]
|
21
|
-
required :filters, -> { TerminalShop::ArrayOf[enum: TerminalShop::Models::ProductAPI::Filter] }
|
22
|
-
|
23
18
|
# @!attribute name
|
24
19
|
# Name of the product.
|
25
20
|
#
|
@@ -55,11 +50,11 @@ module TerminalShop
|
|
55
50
|
# @!attribute [r] tags
|
56
51
|
# Tags for the product.
|
57
52
|
#
|
58
|
-
# @return [
|
59
|
-
optional :tags, TerminalShop::
|
53
|
+
# @return [TerminalShop::Models::ProductAPI::Tags, nil]
|
54
|
+
optional :tags, -> { TerminalShop::Models::ProductAPI::Tags }
|
60
55
|
|
61
56
|
# @!parse
|
62
|
-
# # @return [
|
57
|
+
# # @return [TerminalShop::Models::ProductAPI::Tags]
|
63
58
|
# attr_writer :tags
|
64
59
|
|
65
60
|
# @!parse
|
@@ -67,63 +62,94 @@ module TerminalShop
|
|
67
62
|
# #
|
68
63
|
# # @param id [String]
|
69
64
|
# # @param description [String]
|
70
|
-
# # @param filters [Array<Symbol, TerminalShop::Models::ProductAPI::Filter>]
|
71
65
|
# # @param name [String]
|
72
66
|
# # @param variants [Array<TerminalShop::Models::ProductVariant>]
|
73
67
|
# # @param order [Integer]
|
74
68
|
# # @param subscription [Symbol, TerminalShop::Models::ProductAPI::Subscription]
|
75
|
-
# # @param tags [
|
69
|
+
# # @param tags [TerminalShop::Models::ProductAPI::Tags]
|
76
70
|
# #
|
77
|
-
# def initialize(id:, description:,
|
71
|
+
# def initialize(id:, description:, name:, variants:, order: nil, subscription: nil, tags: nil, **) = super
|
78
72
|
|
79
73
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
80
74
|
|
81
|
-
# @abstract
|
82
|
-
#
|
83
|
-
# @example
|
84
|
-
# ```ruby
|
85
|
-
# case filter
|
86
|
-
# in :eu
|
87
|
-
# # ...
|
88
|
-
# in :na
|
89
|
-
# # ...
|
90
|
-
# end
|
91
|
-
# ```
|
92
|
-
class Filter < TerminalShop::Enum
|
93
|
-
EU = :eu
|
94
|
-
NA = :na
|
95
|
-
|
96
|
-
finalize!
|
97
|
-
|
98
|
-
# @!parse
|
99
|
-
# # @return [Array<Symbol>]
|
100
|
-
# #
|
101
|
-
# def self.values; end
|
102
|
-
end
|
103
|
-
|
104
75
|
# @abstract
|
105
76
|
#
|
106
77
|
# Whether the product must be or can be subscribed to.
|
107
|
-
#
|
108
|
-
# @example
|
109
|
-
# ```ruby
|
110
|
-
# case subscription
|
111
|
-
# in :allowed
|
112
|
-
# # ...
|
113
|
-
# in :required
|
114
|
-
# # ...
|
115
|
-
# end
|
116
|
-
# ```
|
117
78
|
class Subscription < TerminalShop::Enum
|
118
79
|
ALLOWED = :allowed
|
119
80
|
REQUIRED = :required
|
120
81
|
|
121
82
|
finalize!
|
83
|
+
end
|
84
|
+
|
85
|
+
class Tags < TerminalShop::BaseModel
|
86
|
+
# @!attribute [r] app
|
87
|
+
#
|
88
|
+
# @return [String, nil]
|
89
|
+
optional :app, String
|
90
|
+
|
91
|
+
# @!parse
|
92
|
+
# # @return [String]
|
93
|
+
# attr_writer :app
|
94
|
+
|
95
|
+
# @!attribute [r] color
|
96
|
+
#
|
97
|
+
# @return [String, nil]
|
98
|
+
optional :color, String
|
122
99
|
|
123
100
|
# @!parse
|
124
|
-
# # @return [
|
101
|
+
# # @return [String]
|
102
|
+
# attr_writer :color
|
103
|
+
|
104
|
+
# @!attribute [r] featured
|
105
|
+
#
|
106
|
+
# @return [Boolean, nil]
|
107
|
+
optional :featured, TerminalShop::BooleanModel
|
108
|
+
|
109
|
+
# @!parse
|
110
|
+
# # @return [Boolean]
|
111
|
+
# attr_writer :featured
|
112
|
+
|
113
|
+
# @!attribute [r] market_eu
|
114
|
+
#
|
115
|
+
# @return [Boolean, nil]
|
116
|
+
optional :market_eu, TerminalShop::BooleanModel
|
117
|
+
|
118
|
+
# @!parse
|
119
|
+
# # @return [Boolean]
|
120
|
+
# attr_writer :market_eu
|
121
|
+
|
122
|
+
# @!attribute [r] market_na
|
123
|
+
#
|
124
|
+
# @return [Boolean, nil]
|
125
|
+
optional :market_na, TerminalShop::BooleanModel
|
126
|
+
|
127
|
+
# @!parse
|
128
|
+
# # @return [Boolean]
|
129
|
+
# attr_writer :market_na
|
130
|
+
|
131
|
+
# @!attribute [r] type
|
132
|
+
#
|
133
|
+
# @return [String, nil]
|
134
|
+
optional :type, String
|
135
|
+
|
136
|
+
# @!parse
|
137
|
+
# # @return [String]
|
138
|
+
# attr_writer :type
|
139
|
+
|
140
|
+
# @!parse
|
141
|
+
# # Tags for the product.
|
125
142
|
# #
|
126
|
-
#
|
143
|
+
# # @param app [String]
|
144
|
+
# # @param color [String]
|
145
|
+
# # @param featured [Boolean]
|
146
|
+
# # @param market_eu [Boolean]
|
147
|
+
# # @param market_na [Boolean]
|
148
|
+
# # @param type [String]
|
149
|
+
# #
|
150
|
+
# def initialize(app: nil, color: nil, featured: nil, market_eu: nil, market_na: nil, type: nil, **) = super
|
151
|
+
|
152
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
127
153
|
end
|
128
154
|
end
|
129
155
|
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class ProductGetParams < TerminalShop::BaseModel
|
6
|
+
# @!parse
|
7
|
+
# extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
# @!parse
|
11
|
+
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
# #
|
13
|
+
# def initialize(request_options: {}, **) = super
|
14
|
+
|
15
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class ProductGetResponse < TerminalShop::BaseModel
|
6
|
+
# @!attribute data
|
7
|
+
# Product sold in the Terminal shop.
|
8
|
+
#
|
9
|
+
# @return [TerminalShop::Models::ProductAPI]
|
10
|
+
required :data, -> { TerminalShop::Models::ProductAPI }
|
11
|
+
|
12
|
+
# @!parse
|
13
|
+
# # @param data [TerminalShop::Models::ProductAPI]
|
14
|
+
# #
|
15
|
+
# def initialize(data:, **) = super
|
16
|
+
|
17
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -8,23 +8,21 @@ module TerminalShop
|
|
8
8
|
include TerminalShop::RequestParameters
|
9
9
|
|
10
10
|
# @!attribute email
|
11
|
-
# Email address of the user.
|
12
11
|
#
|
13
|
-
# @return [String
|
14
|
-
|
12
|
+
# @return [String]
|
13
|
+
required :email, String
|
15
14
|
|
16
15
|
# @!attribute name
|
17
|
-
# Name of the user.
|
18
16
|
#
|
19
|
-
# @return [String
|
20
|
-
|
17
|
+
# @return [String]
|
18
|
+
required :name, String
|
21
19
|
|
22
20
|
# @!parse
|
23
|
-
# # @param email [String
|
24
|
-
# # @param name [String
|
21
|
+
# # @param email [String]
|
22
|
+
# # @param name [String]
|
25
23
|
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
26
24
|
# #
|
27
|
-
# def initialize(email
|
25
|
+
# def initialize(email:, name:, request_options: {}, **) = super
|
28
26
|
|
29
27
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
30
28
|
end
|
@@ -71,16 +71,6 @@ module TerminalShop
|
|
71
71
|
# @abstract
|
72
72
|
#
|
73
73
|
# Schedule of the subscription.
|
74
|
-
#
|
75
|
-
# @example
|
76
|
-
# ```ruby
|
77
|
-
# case schedule
|
78
|
-
# in TerminalShop::Models::SubscriptionAPI::Schedule::Fixed
|
79
|
-
# # ...
|
80
|
-
# in TerminalShop::Models::SubscriptionAPI::Schedule::Weekly
|
81
|
-
# # ...
|
82
|
-
# end
|
83
|
-
# ```
|
84
74
|
class Schedule < TerminalShop::Union
|
85
75
|
variant -> { TerminalShop::Models::SubscriptionAPI::Schedule::Fixed }
|
86
76
|
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class SubscriptionGetParams < TerminalShop::BaseModel
|
6
|
+
# @!parse
|
7
|
+
# extend TerminalShop::RequestParameters::Converter
|
8
|
+
include TerminalShop::RequestParameters
|
9
|
+
|
10
|
+
# @!parse
|
11
|
+
# # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
|
12
|
+
# #
|
13
|
+
# def initialize(request_options: {}, **) = super
|
14
|
+
|
15
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module TerminalShop
|
4
|
+
module Models
|
5
|
+
class SubscriptionGetResponse < TerminalShop::BaseModel
|
6
|
+
# @!attribute data
|
7
|
+
# Subscription to a Terminal shop product.
|
8
|
+
#
|
9
|
+
# @return [TerminalShop::Models::SubscriptionAPI]
|
10
|
+
required :data, -> { TerminalShop::Models::SubscriptionAPI }
|
11
|
+
|
12
|
+
# @!parse
|
13
|
+
# # @param data [TerminalShop::Models::SubscriptionAPI]
|
14
|
+
# #
|
15
|
+
# def initialize(data:, **) = super
|
16
|
+
|
17
|
+
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|