terminal-shop 0.1.0.pre.alpha.12 → 0.1.0.pre.alpha.13

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: 0faffe9f60961c28b6fbab9b959d5b65da1595d913bd1b74d6f41da0eb449c4c
4
- data.tar.gz: c3d20e0578b8f1656fafa94ebc97b38c1726b1382ee9d5c4cdfafcdaef9d92b4
3
+ metadata.gz: 4d0377b351b29fd528cf8cfac1ca0709534478162601101eff9c1cec288167ac
4
+ data.tar.gz: 9d0178a0d2193ebf30b3d87b056e9958de8f70921088c6877ac1b40c59537a2c
5
5
  SHA512:
6
- metadata.gz: 8b80e5fa7efbdeed121f88a0e435b3d37c62f2c0cd0d0da49f69fe164b22a04eedca3b4682b8731e8181e80362ba4d8c596bd7eafd350e8973cab0e5ac88c2ab
7
- data.tar.gz: 884a37c3363ebad19f5455de196ba2723710f04014947bf36eb1db8f67fdbbe03dc8073f3af47cafe5a9adb61a6db6804c38c8983be5cffee30b1a54a6534757
6
+ metadata.gz: d47c80cc764a70c4d04ce0ec5f0f82c7a374976334608d0bc2579cf58db62637f0c3def0a701756aef8b81817a840c78e7e6236cc52b48e81921fbd537ddf1c0
7
+ data.tar.gz: 0daab830e1738889aa702da0b82b02b9bc5750c0b36dc7bf0e7a6c932e4430926b29047e038a335c3a3fc199b0547bd9f045e4d57b4fff7edd4370ad51896b7a
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class OrderCreateParams < TerminalShop::BaseModel
6
+ # @!parse
7
+ # extend TerminalShop::RequestParameters::Converter
8
+ include TerminalShop::RequestParameters
9
+
10
+ # @!attribute address_id
11
+ # Shipping address ID.
12
+ #
13
+ # @return [String]
14
+ required :address_id, String, api_name: :addressID
15
+
16
+ # @!attribute card_id
17
+ # Card ID.
18
+ #
19
+ # @return [String]
20
+ required :card_id, String, api_name: :cardID
21
+
22
+ # @!attribute variants
23
+ # Product variants to include in the order, along with their quantities.
24
+ #
25
+ # @return [Hash{Symbol=>Integer}]
26
+ required :variants, TerminalShop::HashOf[Integer]
27
+
28
+ # @!parse
29
+ # # @param address_id [String]
30
+ # # @param card_id [String]
31
+ # # @param variants [Hash{Symbol=>Integer}]
32
+ # # @param request_options [TerminalShop::RequestOptions, Hash{Symbol=>Object}]
33
+ # #
34
+ # def initialize(address_id:, card_id:, variants:, request_options: {}, **) = super
35
+
36
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class OrderCreateResponse < TerminalShop::BaseModel
6
+ # @!attribute data
7
+ # Order ID.
8
+ #
9
+ # @return [String]
10
+ required :data, String
11
+
12
+ # @!parse
13
+ # # @param data [String]
14
+ # #
15
+ # def initialize(data:, **) = super
16
+
17
+ # def initialize: (Hash | TerminalShop::BaseModel) -> void
18
+ end
19
+ end
20
+ end
@@ -3,6 +3,31 @@
3
3
  module TerminalShop
4
4
  module Resources
5
5
  class Order
6
+ # Create an order without a cart. The order will be placed immediately.
7
+ #
8
+ # @param params [TerminalShop::Models::OrderCreateParams, Hash{Symbol=>Object}] .
9
+ #
10
+ # @option params [String] :address_id Shipping address ID.
11
+ #
12
+ # @option params [String] :card_id Card ID.
13
+ #
14
+ # @option params [Hash{Symbol=>Integer}] :variants Product variants to include in the order, along with their quantities.
15
+ #
16
+ # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
17
+ #
18
+ # @return [TerminalShop::Models::OrderCreateResponse]
19
+ #
20
+ def create(params)
21
+ parsed, options = TerminalShop::Models::OrderCreateParams.dump_request(params)
22
+ @client.request(
23
+ method: :post,
24
+ path: "order",
25
+ body: parsed,
26
+ model: TerminalShop::Models::OrderCreateResponse,
27
+ options: options
28
+ )
29
+ end
30
+
6
31
  # List the orders associated with the current user.
7
32
  #
8
33
  # @param params [TerminalShop::Models::OrderListParams, Hash{Symbol=>Object}] .
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- VERSION = "0.1.0-alpha.12"
4
+ VERSION = "0.1.0-alpha.13"
5
5
  end
data/lib/terminal-shop.rb CHANGED
@@ -68,6 +68,8 @@ require_relative "terminal-shop/models/cart_set_item_response"
68
68
  require_relative "terminal-shop/models/email_create_params"
69
69
  require_relative "terminal-shop/models/email_create_response"
70
70
  require_relative "terminal-shop/models/order"
71
+ require_relative "terminal-shop/models/order_create_params"
72
+ require_relative "terminal-shop/models/order_create_response"
71
73
  require_relative "terminal-shop/models/order_get_params"
72
74
  require_relative "terminal-shop/models/order_get_response"
73
75
  require_relative "terminal-shop/models/order_list_params"
@@ -0,0 +1,60 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class OrderCreateParams < TerminalShop::BaseModel
6
+ extend TerminalShop::RequestParameters::Converter
7
+ include TerminalShop::RequestParameters
8
+
9
+ sig { returns(String) }
10
+ def address_id
11
+ end
12
+
13
+ sig { params(_: String).returns(String) }
14
+ def address_id=(_)
15
+ end
16
+
17
+ sig { returns(String) }
18
+ def card_id
19
+ end
20
+
21
+ sig { params(_: String).returns(String) }
22
+ def card_id=(_)
23
+ end
24
+
25
+ sig { returns(T::Hash[Symbol, Integer]) }
26
+ def variants
27
+ end
28
+
29
+ sig { params(_: T::Hash[Symbol, Integer]).returns(T::Hash[Symbol, Integer]) }
30
+ def variants=(_)
31
+ end
32
+
33
+ sig do
34
+ params(
35
+ address_id: String,
36
+ card_id: String,
37
+ variants: T::Hash[Symbol, Integer],
38
+ request_options: T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything])
39
+ )
40
+ .void
41
+ end
42
+ def initialize(address_id:, card_id:, variants:, request_options: {})
43
+ end
44
+
45
+ sig do
46
+ override
47
+ .returns(
48
+ {
49
+ address_id: String,
50
+ card_id: String,
51
+ variants: T::Hash[Symbol, Integer],
52
+ request_options: TerminalShop::RequestOptions
53
+ }
54
+ )
55
+ end
56
+ def to_hash
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class OrderCreateResponse < TerminalShop::BaseModel
6
+ sig { returns(String) }
7
+ def data
8
+ end
9
+
10
+ sig { params(_: String).returns(String) }
11
+ def data=(_)
12
+ end
13
+
14
+ sig { params(data: String).void }
15
+ def initialize(data:)
16
+ end
17
+
18
+ sig { override.returns({data: String}) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end
@@ -3,6 +3,18 @@
3
3
  module TerminalShop
4
4
  module Resources
5
5
  class Order
6
+ sig do
7
+ params(
8
+ address_id: String,
9
+ card_id: String,
10
+ variants: T::Hash[Symbol, Integer],
11
+ request_options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything]))
12
+ )
13
+ .returns(TerminalShop::Models::OrderCreateResponse)
14
+ end
15
+ def create(address_id:, card_id:, variants:, request_options: {})
16
+ end
17
+
6
18
  sig do
7
19
  params(request_options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything])))
8
20
  .returns(TerminalShop::Models::OrderListResponse)
@@ -1,5 +1,5 @@
1
1
  # typed: strong
2
2
 
3
3
  module TerminalShop
4
- VERSION = "0.1.0-alpha.12"
4
+ VERSION = "0.1.0-alpha.13"
5
5
  end
@@ -0,0 +1,32 @@
1
+ module TerminalShop
2
+ module Models
3
+ type order_create_params =
4
+ { address_id: String, card_id: String, variants: ::Hash[Symbol, Integer] }
5
+ & TerminalShop::request_parameters
6
+
7
+ class OrderCreateParams < TerminalShop::BaseModel
8
+ extend TerminalShop::RequestParameters::Converter
9
+ include TerminalShop::RequestParameters
10
+
11
+ attr_accessor address_id: String
12
+
13
+ attr_accessor card_id: String
14
+
15
+ attr_accessor variants: ::Hash[Symbol, Integer]
16
+
17
+ def initialize:
18
+ (
19
+ address_id: String,
20
+ card_id: String,
21
+ variants: ::Hash[Symbol, Integer],
22
+ request_options: TerminalShop::request_opts
23
+ ) -> void
24
+ | (
25
+ ?TerminalShop::Models::order_create_params
26
+ | TerminalShop::BaseModel data
27
+ ) -> void
28
+
29
+ def to_hash: -> TerminalShop::Models::order_create_params
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,18 @@
1
+ module TerminalShop
2
+ module Models
3
+ type order_create_response = { data: String }
4
+
5
+ class OrderCreateResponse < TerminalShop::BaseModel
6
+ attr_accessor data: String
7
+
8
+ def initialize:
9
+ (data: String) -> void
10
+ | (
11
+ ?TerminalShop::Models::order_create_response
12
+ | TerminalShop::BaseModel data
13
+ ) -> void
14
+
15
+ def to_hash: -> TerminalShop::Models::order_create_response
16
+ end
17
+ end
18
+ end
@@ -1,6 +1,17 @@
1
1
  module TerminalShop
2
2
  module Resources
3
3
  class Order
4
+ def create:
5
+ (
6
+ TerminalShop::Models::OrderCreateParams | ::Hash[Symbol, top] params
7
+ ) -> TerminalShop::Models::OrderCreateResponse
8
+ | (
9
+ address_id: String,
10
+ card_id: String,
11
+ variants: ::Hash[Symbol, Integer],
12
+ request_options: TerminalShop::request_opts
13
+ ) -> TerminalShop::Models::OrderCreateResponse
14
+
4
15
  def list:
5
16
  (
6
17
  ?TerminalShop::Models::OrderListParams | ::Hash[Symbol, top] params
@@ -1,3 +1,3 @@
1
1
  module TerminalShop
2
- VERSION: "0.1.0-alpha.11"
2
+ VERSION: "0.1.0-alpha.12"
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: 0.1.0.pre.alpha.12
4
+ version: 0.1.0.pre.alpha.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Terminal
@@ -78,6 +78,8 @@ files:
78
78
  - lib/terminal-shop/models/email_create_params.rb
79
79
  - lib/terminal-shop/models/email_create_response.rb
80
80
  - lib/terminal-shop/models/order.rb
81
+ - lib/terminal-shop/models/order_create_params.rb
82
+ - lib/terminal-shop/models/order_create_response.rb
81
83
  - lib/terminal-shop/models/order_get_params.rb
82
84
  - lib/terminal-shop/models/order_get_response.rb
83
85
  - lib/terminal-shop/models/order_list_params.rb
@@ -170,6 +172,8 @@ files:
170
172
  - rbi/lib/terminal-shop/models/email_create_params.rbi
171
173
  - rbi/lib/terminal-shop/models/email_create_response.rbi
172
174
  - rbi/lib/terminal-shop/models/order.rbi
175
+ - rbi/lib/terminal-shop/models/order_create_params.rbi
176
+ - rbi/lib/terminal-shop/models/order_create_response.rbi
173
177
  - rbi/lib/terminal-shop/models/order_get_params.rbi
174
178
  - rbi/lib/terminal-shop/models/order_get_response.rbi
175
179
  - rbi/lib/terminal-shop/models/order_list_params.rbi
@@ -261,6 +265,8 @@ files:
261
265
  - sig/terminal-shop/models/email_create_params.rbs
262
266
  - sig/terminal-shop/models/email_create_response.rbs
263
267
  - sig/terminal-shop/models/order.rbs
268
+ - sig/terminal-shop/models/order_create_params.rbs
269
+ - sig/terminal-shop/models/order_create_response.rbs
264
270
  - sig/terminal-shop/models/order_get_params.rbs
265
271
  - sig/terminal-shop/models/order_get_response.rbs
266
272
  - sig/terminal-shop/models/order_list_params.rbs