terminal-shop 1.0.0 → 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_model.rb +448 -438
- 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 +11 -6
- data/lib/terminal-shop/resources/cart.rb +43 -1
- data/lib/terminal-shop/util.rb +3 -3
- data/lib/terminal-shop/version.rb +1 -1
- data/lib/terminal-shop.rb +4 -0
- data/rbi/lib/terminal-shop/base_client.rbi +23 -21
- data/rbi/lib/terminal-shop/base_model.rbi +235 -217
- data/rbi/lib/terminal-shop/client.rbi +2 -2
- data/rbi/lib/terminal-shop/errors.rbi +8 -8
- 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 +5 -2
- data/rbi/lib/terminal-shop/models/address_get_response.rbi +2 -2
- 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 +2 -2
- 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 +5 -2
- data/rbi/lib/terminal-shop/models/card_get_response.rbi +2 -2
- 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 +29 -14
- data/rbi/lib/terminal-shop/models/product_get_params.rbi +5 -2
- data/rbi/lib/terminal-shop/models/product_get_response.rbi +2 -2
- 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 +2 -2
- 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 +5 -2
- data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +2 -2
- 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 +2 -2
- data/rbi/lib/terminal-shop/resources/app.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/card.rbi +2 -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 +2 -2
- data/rbi/lib/terminal-shop/resources/profile.rbi +2 -2
- data/rbi/lib/terminal-shop/resources/subscription.rbi +2 -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 +146 -126
- data/rbi/lib/terminal-shop/version.rbi +1 -1
- 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 +8 -2
- data/sig/terminal-shop/request_options.rbs +4 -0
- data/sig/terminal-shop/resources/cart.rbs +20 -0
- data/sig/terminal-shop/version.rbs +1 -1
- metadata +14 -2
@@ -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
|
@@ -80,11 +80,6 @@ module TerminalShop
|
|
80
80
|
REQUIRED = :required
|
81
81
|
|
82
82
|
finalize!
|
83
|
-
|
84
|
-
# @!parse
|
85
|
-
# # @return [Array<Symbol>]
|
86
|
-
# #
|
87
|
-
# def self.values; end
|
88
83
|
end
|
89
84
|
|
90
85
|
class Tags < TerminalShop::BaseModel
|
@@ -133,6 +128,15 @@ module TerminalShop
|
|
133
128
|
# # @return [Boolean]
|
134
129
|
# attr_writer :market_na
|
135
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
|
+
|
136
140
|
# @!parse
|
137
141
|
# # Tags for the product.
|
138
142
|
# #
|
@@ -141,8 +145,9 @@ module TerminalShop
|
|
141
145
|
# # @param featured [Boolean]
|
142
146
|
# # @param market_eu [Boolean]
|
143
147
|
# # @param market_na [Boolean]
|
148
|
+
# # @param type [String]
|
144
149
|
# #
|
145
|
-
# def initialize(app: nil, color: nil, featured: nil, market_eu: nil, market_na: nil, **) = super
|
150
|
+
# def initialize(app: nil, color: nil, featured: nil, market_eu: nil, market_na: nil, type: nil, **) = super
|
146
151
|
|
147
152
|
# def initialize: (Hash | TerminalShop::BaseModel) -> void
|
148
153
|
end
|
@@ -7,16 +7,20 @@ module TerminalShop
|
|
7
7
|
#
|
8
8
|
# @param params [TerminalShop::Models::CartConvertParams, Hash{Symbol=>Object}] .
|
9
9
|
#
|
10
|
+
# @option params [String] :recipient_email
|
11
|
+
#
|
10
12
|
# @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
|
11
13
|
#
|
12
14
|
# @return [TerminalShop::Models::CartConvertResponse]
|
13
15
|
#
|
14
16
|
def convert(params = {})
|
17
|
+
parsed, options = TerminalShop::Models::CartConvertParams.dump_request(params)
|
15
18
|
@client.request(
|
16
19
|
method: :post,
|
17
20
|
path: "cart/convert",
|
21
|
+
body: parsed,
|
18
22
|
model: TerminalShop::Models::CartConvertResponse,
|
19
|
-
options:
|
23
|
+
options: options
|
20
24
|
)
|
21
25
|
end
|
22
26
|
|
@@ -37,6 +41,44 @@ module TerminalShop
|
|
37
41
|
)
|
38
42
|
end
|
39
43
|
|
44
|
+
# Apply a gift card to the current user's cart.
|
45
|
+
#
|
46
|
+
# @param params [TerminalShop::Models::CartRedeemGiftCardParams, Hash{Symbol=>Object}] .
|
47
|
+
#
|
48
|
+
# @option params [String] :gift_card_id
|
49
|
+
#
|
50
|
+
# @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
|
51
|
+
#
|
52
|
+
# @return [TerminalShop::Models::CartRedeemGiftCardResponse]
|
53
|
+
#
|
54
|
+
def redeem_gift_card(params)
|
55
|
+
parsed, options = TerminalShop::Models::CartRedeemGiftCardParams.dump_request(params)
|
56
|
+
@client.request(
|
57
|
+
method: :put,
|
58
|
+
path: "cart/gift-card",
|
59
|
+
body: parsed,
|
60
|
+
model: TerminalShop::Models::CartRedeemGiftCardResponse,
|
61
|
+
options: options
|
62
|
+
)
|
63
|
+
end
|
64
|
+
|
65
|
+
# Remove the gift card from the current user's cart.
|
66
|
+
#
|
67
|
+
# @param params [TerminalShop::Models::CartRemoveGiftCardParams, Hash{Symbol=>Object}] .
|
68
|
+
#
|
69
|
+
# @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
|
70
|
+
#
|
71
|
+
# @return [TerminalShop::Models::CartRemoveGiftCardResponse]
|
72
|
+
#
|
73
|
+
def remove_gift_card(params = {})
|
74
|
+
@client.request(
|
75
|
+
method: :delete,
|
76
|
+
path: "cart/gift-card",
|
77
|
+
model: TerminalShop::Models::CartRemoveGiftCardResponse,
|
78
|
+
options: params[:request_options]
|
79
|
+
)
|
80
|
+
end
|
81
|
+
|
40
82
|
# Set the shipping address for the current user's cart.
|
41
83
|
#
|
42
84
|
# @param params [TerminalShop::Models::CartSetAddressParams, Hash{Symbol=>Object}] .
|
data/lib/terminal-shop/util.rb
CHANGED
@@ -505,10 +505,10 @@ module TerminalShop
|
|
505
505
|
json
|
506
506
|
end
|
507
507
|
in %r{^text/event-stream}
|
508
|
-
lines =
|
509
|
-
|
508
|
+
lines = decode_lines(stream)
|
509
|
+
decode_sse(lines)
|
510
510
|
in %r{^application/(?:x-)?jsonl}
|
511
|
-
|
511
|
+
decode_lines(stream)
|
512
512
|
in %r{^text/}
|
513
513
|
stream.to_a.join
|
514
514
|
else
|
data/lib/terminal-shop.rb
CHANGED
@@ -63,6 +63,10 @@ require_relative "terminal-shop/models/cart_convert_params"
|
|
63
63
|
require_relative "terminal-shop/models/cart_convert_response"
|
64
64
|
require_relative "terminal-shop/models/cart_get_params"
|
65
65
|
require_relative "terminal-shop/models/cart_get_response"
|
66
|
+
require_relative "terminal-shop/models/cart_redeem_gift_card_params"
|
67
|
+
require_relative "terminal-shop/models/cart_redeem_gift_card_response"
|
68
|
+
require_relative "terminal-shop/models/cart_remove_gift_card_params"
|
69
|
+
require_relative "terminal-shop/models/cart_remove_gift_card_response"
|
66
70
|
require_relative "terminal-shop/models/cart_set_address_params"
|
67
71
|
require_relative "terminal-shop/models/cart_set_address_response"
|
68
72
|
require_relative "terminal-shop/models/cart_set_card_params"
|
@@ -43,25 +43,27 @@ module TerminalShop
|
|
43
43
|
|
44
44
|
PLATFORM_HEADERS = T::Hash[String, String]
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
46
|
+
class << self
|
47
|
+
sig { params(req: TerminalShop::BaseClient::RequestComponentsShape).void }
|
48
|
+
def validate!(req)
|
49
|
+
end
|
50
|
+
|
51
|
+
sig do
|
52
|
+
params(status: Integer, headers: T.any(T::Hash[String, String], Net::HTTPHeader)).returns(T::Boolean)
|
53
|
+
end
|
54
|
+
def should_retry?(status, headers:)
|
55
|
+
end
|
56
|
+
|
57
|
+
sig do
|
58
|
+
params(
|
59
|
+
request: TerminalShop::BaseClient::RequestInputShape,
|
60
|
+
status: Integer,
|
61
|
+
response_headers: T.any(T::Hash[String, String], Net::HTTPHeader)
|
62
|
+
)
|
63
|
+
.returns(TerminalShop::BaseClient::RequestInputShape)
|
64
|
+
end
|
65
|
+
def follow_redirect(request, status:, response_headers:)
|
66
|
+
end
|
65
67
|
end
|
66
68
|
|
67
69
|
sig { returns(T.anything) }
|
@@ -83,9 +85,9 @@ module TerminalShop
|
|
83
85
|
T.nilable(T.any(String, Integer, T::Array[T.nilable(T.any(String, Integer))]))],
|
84
86
|
idempotency_header: T.nilable(String)
|
85
87
|
)
|
86
|
-
.
|
88
|
+
.returns(T.attached_class)
|
87
89
|
end
|
88
|
-
def
|
90
|
+
def self.new(
|
89
91
|
base_url:,
|
90
92
|
timeout: 0.0,
|
91
93
|
max_retries: 0,
|