terminal-shop 0.1.0.pre.alpha.15 → 1.0.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.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/lib/terminal-shop/base_client.rb +35 -55
  3. data/lib/terminal-shop/base_model.rb +9 -0
  4. data/lib/terminal-shop/base_page.rb +2 -2
  5. data/lib/terminal-shop/client.rb +1 -1
  6. data/lib/terminal-shop/errors.rb +3 -2
  7. data/lib/terminal-shop/models/address_get_params.rb +18 -0
  8. data/lib/terminal-shop/models/address_get_response.rb +20 -0
  9. data/lib/terminal-shop/models/app_create_params.rb +14 -2
  10. data/lib/terminal-shop/models/card_get_params.rb +18 -0
  11. data/lib/terminal-shop/models/card_get_response.rb +20 -0
  12. data/lib/terminal-shop/models/product.rb +63 -42
  13. data/lib/terminal-shop/models/product_get_params.rb +18 -0
  14. data/lib/terminal-shop/models/product_get_response.rb +20 -0
  15. data/lib/terminal-shop/models/profile_update_params.rb +7 -9
  16. data/lib/terminal-shop/models/subscription.rb +0 -10
  17. data/lib/terminal-shop/models/subscription_get_params.rb +18 -0
  18. data/lib/terminal-shop/models/subscription_get_response.rb +20 -0
  19. data/lib/terminal-shop/pooled_net_requester.rb +14 -9
  20. data/lib/terminal-shop/resources/address.rb +19 -0
  21. data/lib/terminal-shop/resources/app.rb +2 -6
  22. data/lib/terminal-shop/resources/card.rb +19 -0
  23. data/lib/terminal-shop/resources/product.rb +19 -0
  24. data/lib/terminal-shop/resources/profile.rb +3 -3
  25. data/lib/terminal-shop/resources/subscription.rb +19 -0
  26. data/lib/terminal-shop/util.rb +135 -1
  27. data/lib/terminal-shop/version.rb +1 -1
  28. data/lib/terminal-shop.rb +9 -1
  29. data/rbi/lib/terminal-shop/base_client.rbi +6 -14
  30. data/rbi/lib/terminal-shop/base_page.rbi +2 -2
  31. data/rbi/lib/terminal-shop/errors.rbi +3 -2
  32. data/rbi/lib/terminal-shop/models/address_get_params.rbi +18 -0
  33. data/rbi/lib/terminal-shop/models/address_get_response.rbi +23 -0
  34. data/rbi/lib/terminal-shop/models/app_create_params.rbi +29 -4
  35. data/rbi/lib/terminal-shop/models/card_get_params.rbi +18 -0
  36. data/rbi/lib/terminal-shop/models/card_get_response.rbi +23 -0
  37. data/rbi/lib/terminal-shop/models/product.rbi +70 -24
  38. data/rbi/lib/terminal-shop/models/product_get_params.rbi +18 -0
  39. data/rbi/lib/terminal-shop/models/product_get_response.rbi +23 -0
  40. data/rbi/lib/terminal-shop/models/profile_update_params.rbi +8 -13
  41. data/rbi/lib/terminal-shop/models/subscription_get_params.rbi +18 -0
  42. data/rbi/lib/terminal-shop/models/subscription_get_response.rbi +23 -0
  43. data/rbi/lib/terminal-shop/resources/address.rbi +10 -0
  44. data/rbi/lib/terminal-shop/resources/app.rbi +1 -3
  45. data/rbi/lib/terminal-shop/resources/card.rbi +10 -0
  46. data/rbi/lib/terminal-shop/resources/product.rbi +10 -0
  47. data/rbi/lib/terminal-shop/resources/profile.rbi +3 -3
  48. data/rbi/lib/terminal-shop/resources/subscription.rbi +10 -0
  49. data/rbi/lib/terminal-shop/util.rbi +29 -0
  50. data/rbi/lib/terminal-shop/version.rbi +1 -1
  51. data/sig/terminal-shop/base_client.rbs +3 -7
  52. data/sig/terminal-shop/base_page.rbs +1 -1
  53. data/sig/terminal-shop/errors.rbs +2 -1
  54. data/sig/terminal-shop/models/address_get_params.rbs +19 -0
  55. data/sig/terminal-shop/models/address_get_response.rbs +18 -0
  56. data/sig/terminal-shop/models/app_create_params.rbs +12 -3
  57. data/sig/terminal-shop/models/card_get_params.rbs +18 -0
  58. data/sig/terminal-shop/models/card_get_response.rbs +18 -0
  59. data/sig/terminal-shop/models/product.rbs +52 -17
  60. data/sig/terminal-shop/models/product_get_params.rbs +19 -0
  61. data/sig/terminal-shop/models/product_get_response.rbs +18 -0
  62. data/sig/terminal-shop/models/profile_update_params.rbs +5 -5
  63. data/sig/terminal-shop/models/subscription_get_params.rbs +19 -0
  64. data/sig/terminal-shop/models/subscription_get_response.rbs +19 -0
  65. data/sig/terminal-shop/resources/address.rbs +10 -0
  66. data/sig/terminal-shop/resources/app.rbs +0 -2
  67. data/sig/terminal-shop/resources/card.rbs +10 -0
  68. data/sig/terminal-shop/resources/product.rbs +10 -0
  69. data/sig/terminal-shop/resources/profile.rbs +3 -4
  70. data/sig/terminal-shop/resources/subscription.rbs +11 -0
  71. data/sig/terminal-shop/util.rbs +19 -0
  72. data/sig/terminal-shop/version.rbs +1 -1
  73. metadata +28 -4
@@ -74,6 +74,25 @@ module TerminalShop
74
74
  )
75
75
  end
76
76
 
77
+ # Get the shipping address with the given ID.
78
+ #
79
+ # @param id [String] ID of the shipping address to get.
80
+ #
81
+ # @param params [TerminalShop::Models::AddressGetParams, Hash{Symbol=>Object}] .
82
+ #
83
+ # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
84
+ #
85
+ # @return [TerminalShop::Models::AddressGetResponse]
86
+ #
87
+ def get(id, params = {})
88
+ @client.request(
89
+ method: :get,
90
+ path: ["address/%0s", id],
91
+ model: TerminalShop::Models::AddressGetResponse,
92
+ options: params[:request_options]
93
+ )
94
+ end
95
+
77
96
  # @param client [TerminalShop::Client]
78
97
  #
79
98
  def initialize(client:)
@@ -7,13 +7,9 @@ module TerminalShop
7
7
  #
8
8
  # @param params [TerminalShop::Models::AppCreateParams, Hash{Symbol=>Object}] .
9
9
  #
10
- # @option params [String] :id Unique object identifier. The format and length of IDs may change over time.
10
+ # @option params [String] :name
11
11
  #
12
- # @option params [String] :name Name of the app.
13
- #
14
- # @option params [String] :redirect_uri Redirect URI of the app.
15
- #
16
- # @option params [String] :secret OAuth 2.0 client secret of the app (obfuscated).
12
+ # @option params [String] :redirect_uri
17
13
  #
18
14
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
19
15
  #
@@ -79,6 +79,25 @@ module TerminalShop
79
79
  )
80
80
  end
81
81
 
82
+ # Get a credit card by ID associated with the current user.
83
+ #
84
+ # @param id [String] ID of the card to get.
85
+ #
86
+ # @param params [TerminalShop::Models::CardGetParams, Hash{Symbol=>Object}] .
87
+ #
88
+ # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
89
+ #
90
+ # @return [TerminalShop::Models::CardGetResponse]
91
+ #
92
+ def get(id, params = {})
93
+ @client.request(
94
+ method: :get,
95
+ path: ["card/%0s", id],
96
+ model: TerminalShop::Models::CardGetResponse,
97
+ options: params[:request_options]
98
+ )
99
+ end
100
+
82
101
  # @param client [TerminalShop::Client]
83
102
  #
84
103
  def initialize(client:)
@@ -20,6 +20,25 @@ module TerminalShop
20
20
  )
21
21
  end
22
22
 
23
+ # Get a product by ID from the Terminal shop.
24
+ #
25
+ # @param id [String] ID of the product to get.
26
+ #
27
+ # @param params [TerminalShop::Models::ProductGetParams, Hash{Symbol=>Object}] .
28
+ #
29
+ # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
30
+ #
31
+ # @return [TerminalShop::Models::ProductGetResponse]
32
+ #
33
+ def get(id, params = {})
34
+ @client.request(
35
+ method: :get,
36
+ path: ["product/%0s", id],
37
+ model: TerminalShop::Models::ProductGetResponse,
38
+ options: params[:request_options]
39
+ )
40
+ end
41
+
23
42
  # @param client [TerminalShop::Client]
24
43
  #
25
44
  def initialize(client:)
@@ -7,15 +7,15 @@ module TerminalShop
7
7
  #
8
8
  # @param params [TerminalShop::Models::ProfileUpdateParams, Hash{Symbol=>Object}] .
9
9
  #
10
- # @option params [String, nil] :email Email address of the user.
10
+ # @option params [String] :email
11
11
  #
12
- # @option params [String, nil] :name Name of the user.
12
+ # @option params [String] :name
13
13
  #
14
14
  # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
15
15
  #
16
16
  # @return [TerminalShop::Models::ProfileUpdateResponse]
17
17
  #
18
- def update(params = {})
18
+ def update(params)
19
19
  parsed, options = TerminalShop::Models::ProfileUpdateParams.dump_request(params)
20
20
  @client.request(
21
21
  method: :put,
@@ -72,6 +72,25 @@ module TerminalShop
72
72
  )
73
73
  end
74
74
 
75
+ # Get the subscription with the given ID.
76
+ #
77
+ # @param id [String] ID of the subscription to get.
78
+ #
79
+ # @param params [TerminalShop::Models::SubscriptionGetParams, Hash{Symbol=>Object}] .
80
+ #
81
+ # @option params [TerminalShop::RequestOptions, Hash{Symbol=>Object}, nil] :request_options
82
+ #
83
+ # @return [TerminalShop::Models::SubscriptionGetResponse]
84
+ #
85
+ def get(id, params = {})
86
+ @client.request(
87
+ method: :get,
88
+ path: ["subscription/%0s", id],
89
+ model: TerminalShop::Models::SubscriptionGetResponse,
90
+ options: params[:request_options]
91
+ )
92
+ end
93
+
75
94
  # @param client [TerminalShop::Client]
76
95
  #
77
96
  def initialize(client:)
@@ -496,7 +496,7 @@ module TerminalShop
496
496
  #
497
497
  def decode_content(headers, stream:, suppress_error: false)
498
498
  case headers["content-type"]
499
- in %r{^application/json}
499
+ in %r{^application/(?:vnd\.api\+)?json}
500
500
  json = stream.to_a.join
501
501
  begin
502
502
  JSON.parse(json, symbolize_names: true)
@@ -504,6 +504,11 @@ module TerminalShop
504
504
  raise e unless suppress_error
505
505
  json
506
506
  end
507
+ in %r{^text/event-stream}
508
+ lines = enum_lines(stream)
509
+ parse_sse(lines)
510
+ in %r{^application/(?:x-)?jsonl}
511
+ enum_lines(stream)
507
512
  in %r{^text/}
508
513
  stream.to_a.join
509
514
  else
@@ -512,6 +517,135 @@ module TerminalShop
512
517
  end
513
518
  end
514
519
  end
520
+
521
+ class << self
522
+ # @private
523
+ #
524
+ # https://doc.rust-lang.org/std/iter/trait.FusedIterator.html
525
+ #
526
+ # @param enum [Enumerable]
527
+ # @param close [Proc]
528
+ #
529
+ # @return [Enumerable]
530
+ #
531
+ def fused_enum(enum, &close)
532
+ fused = false
533
+ iter = Enumerator.new do |y|
534
+ next if fused
535
+
536
+ fused = true
537
+ loop { y << enum.next }
538
+ ensure
539
+ close&.call
540
+ close = nil
541
+ end
542
+
543
+ iter.define_singleton_method(:rewind) do
544
+ fused = true
545
+ self
546
+ end
547
+ iter
548
+ end
549
+
550
+ # @private
551
+ #
552
+ # @param enum [Enumerable, nil]
553
+ #
554
+ def close_fused!(enum)
555
+ return unless enum.is_a?(Enumerator)
556
+
557
+ # rubocop:disable Lint/UnreachableLoop
558
+ enum.rewind.each { break }
559
+ # rubocop:enable Lint/UnreachableLoop
560
+ end
561
+
562
+ # @private
563
+ #
564
+ # @param enum [Enumerable, nil]
565
+ # @param blk [Proc]
566
+ #
567
+ def chain_fused(enum, &blk)
568
+ iter = Enumerator.new { blk.call(_1) }
569
+ fused_enum(iter) { close_fused!(enum) }
570
+ end
571
+ end
572
+
573
+ class << self
574
+ # @private
575
+ #
576
+ # @param enum [Enumerable]
577
+ #
578
+ # @return [Enumerable]
579
+ #
580
+ def decode_lines(enum)
581
+ re = /(\r\n|\r|\n)/
582
+ buffer = String.new.b
583
+ cr_seen = nil
584
+
585
+ chain_fused(enum) do |y|
586
+ enum.each do |row|
587
+ buffer << row
588
+ while (match = re.match(buffer, cr_seen.to_i))
589
+ case [match.captures.first, cr_seen]
590
+ in ["\r", nil]
591
+ cr_seen = match.end(1)
592
+ next
593
+ in ["\r" | "\r\n", Integer]
594
+ y << buffer.slice!(..(cr_seen.pred))
595
+ else
596
+ y << buffer.slice!(..(match.end(1).pred))
597
+ end
598
+ cr_seen = nil
599
+ end
600
+ end
601
+
602
+ y << buffer.slice!(..(cr_seen.pred)) unless cr_seen.nil?
603
+ y << buffer unless buffer.empty?
604
+ end
605
+ end
606
+
607
+ # @private
608
+ #
609
+ # https://html.spec.whatwg.org/multipage/server-sent-events.html#parsing-an-event-stream
610
+ #
611
+ # @param lines [Enumerable]
612
+ #
613
+ # @return [Hash{Symbol=>Object}]
614
+ #
615
+ def decode_sse(lines)
616
+ chain_fused(lines) do |y|
617
+ blank = {event: nil, data: nil, id: nil, retry: nil}
618
+ current = {}
619
+
620
+ lines.each do |line|
621
+ case line.sub(/\R$/, "")
622
+ in ""
623
+ next if current.empty?
624
+ y << {**blank, **current}
625
+ current = {}
626
+ in /^:/
627
+ next
628
+ in /^([^:]+):\s?(.*)$/
629
+ field, value = Regexp.last_match.captures
630
+ case field
631
+ in "event"
632
+ current.merge!(event: value)
633
+ in "data"
634
+ (current[:data] ||= String.new.b) << value << "\n"
635
+ in "id" unless value.include?("\0")
636
+ current.merge!(id: value)
637
+ in "retry" if /^\d+$/ =~ value
638
+ current.merge!(retry: Integer(value))
639
+ else
640
+ end
641
+ else
642
+ end
643
+ end
644
+
645
+ y << {**blank, **current} unless current.empty?
646
+ end
647
+ end
648
+ end
515
649
  end
516
650
 
517
651
  # rubocop:enable Metrics/ModuleLength
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TerminalShop
4
- VERSION = "0.1.0-alpha.15"
4
+ VERSION = "1.0.0"
5
5
  end
data/lib/terminal-shop.rb CHANGED
@@ -28,15 +28,17 @@ require_relative "terminal-shop/errors"
28
28
  require_relative "terminal-shop/base_client"
29
29
  require_relative "terminal-shop/pooled_net_requester"
30
30
  require_relative "terminal-shop/client"
31
- require_relative "terminal-shop/models/app"
32
31
  require_relative "terminal-shop/models/subscription"
33
32
  require_relative "terminal-shop/models/address"
34
33
  require_relative "terminal-shop/models/address_create_params"
35
34
  require_relative "terminal-shop/models/address_create_response"
36
35
  require_relative "terminal-shop/models/address_delete_params"
37
36
  require_relative "terminal-shop/models/address_delete_response"
37
+ require_relative "terminal-shop/models/address_get_params"
38
+ require_relative "terminal-shop/models/address_get_response"
38
39
  require_relative "terminal-shop/models/address_list_params"
39
40
  require_relative "terminal-shop/models/address_list_response"
41
+ require_relative "terminal-shop/models/app"
40
42
  require_relative "terminal-shop/models/app_create_params"
41
43
  require_relative "terminal-shop/models/app_create_response"
42
44
  require_relative "terminal-shop/models/app_delete_params"
@@ -52,6 +54,8 @@ require_relative "terminal-shop/models/card_create_params"
52
54
  require_relative "terminal-shop/models/card_create_response"
53
55
  require_relative "terminal-shop/models/card_delete_params"
54
56
  require_relative "terminal-shop/models/card_delete_response"
57
+ require_relative "terminal-shop/models/card_get_params"
58
+ require_relative "terminal-shop/models/card_get_response"
55
59
  require_relative "terminal-shop/models/card_list_params"
56
60
  require_relative "terminal-shop/models/card_list_response"
57
61
  require_relative "terminal-shop/models/cart"
@@ -75,6 +79,8 @@ require_relative "terminal-shop/models/order_get_response"
75
79
  require_relative "terminal-shop/models/order_list_params"
76
80
  require_relative "terminal-shop/models/order_list_response"
77
81
  require_relative "terminal-shop/models/product"
82
+ require_relative "terminal-shop/models/product_get_params"
83
+ require_relative "terminal-shop/models/product_get_response"
78
84
  require_relative "terminal-shop/models/product_list_params"
79
85
  require_relative "terminal-shop/models/product_list_response"
80
86
  require_relative "terminal-shop/models/product_variant"
@@ -87,6 +93,8 @@ require_relative "terminal-shop/models/subscription_create_params"
87
93
  require_relative "terminal-shop/models/subscription_create_response"
88
94
  require_relative "terminal-shop/models/subscription_delete_params"
89
95
  require_relative "terminal-shop/models/subscription_delete_response"
96
+ require_relative "terminal-shop/models/subscription_get_params"
97
+ require_relative "terminal-shop/models/subscription_get_response"
90
98
  require_relative "terminal-shop/models/subscription_list_params"
91
99
  require_relative "terminal-shop/models/subscription_list_response"
92
100
  require_relative "terminal-shop/models/token"
@@ -21,7 +21,8 @@ module TerminalShop
21
21
  ),
22
22
  body: T.nilable(T.anything),
23
23
  unwrap: T.nilable(Symbol),
24
- page: T.nilable(T::Class[TerminalShop::BaseModel]),
24
+ page: T.nilable(T::Class[TerminalShop::BasePage[TerminalShop::BaseModel]]),
25
+ stream: T.nilable(T::Class[T.anything]),
25
26
  model: T.nilable(TerminalShop::Converter::Input),
26
27
  options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything]))
27
28
  }
@@ -122,22 +123,11 @@ module TerminalShop
122
123
  retry_count: Integer,
123
124
  send_retry_header: T::Boolean
124
125
  )
125
- .returns([Net::HTTPResponse, T::Enumerable[String]])
126
+ .returns([Integer, Net::HTTPResponse, T::Enumerable[String]])
126
127
  end
127
128
  private def send_request(request, redirect_count:, retry_count:, send_retry_header:)
128
129
  end
129
130
 
130
- sig do
131
- params(
132
- req: TerminalShop::BaseClient::RequestComponentsShape,
133
- headers: T.any(T::Hash[String, String], Net::HTTPHeader),
134
- stream: T::Enumerable[String]
135
- )
136
- .returns(T.anything)
137
- end
138
- private def parse_response(req, headers:, stream:)
139
- end
140
-
141
131
  sig do
142
132
  params(
143
133
  method: Symbol,
@@ -155,7 +145,8 @@ module TerminalShop
155
145
  ),
156
146
  body: T.nilable(T.anything),
157
147
  unwrap: T.nilable(Symbol),
158
- page: T.nilable(T::Class[TerminalShop::BaseModel]),
148
+ page: T.nilable(T::Class[TerminalShop::BasePage[TerminalShop::BaseModel]]),
149
+ stream: T.nilable(T::Class[T.anything]),
159
150
  model: T.nilable(TerminalShop::Converter::Input),
160
151
  options: T.nilable(T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything]))
161
152
  )
@@ -169,6 +160,7 @@ module TerminalShop
169
160
  body: nil,
170
161
  unwrap: nil,
171
162
  page: nil,
163
+ stream: nil,
172
164
  model: TerminalShop::Unknown,
173
165
  options: {}
174
166
  )
@@ -29,11 +29,11 @@ module TerminalShop
29
29
  client: TerminalShop::BaseClient,
30
30
  req: TerminalShop::BaseClient::RequestComponentsShape,
31
31
  headers: T.any(T::Hash[String, String], Net::HTTPHeader),
32
- unwrapped: T.anything
32
+ page_data: T.anything
33
33
  )
34
34
  .void
35
35
  end
36
- def initialize(client:, req:, headers:, unwrapped:)
36
+ def initialize(client:, req:, headers:, page_data:)
37
37
  end
38
38
  end
39
39
  end
@@ -85,11 +85,12 @@ module TerminalShop
85
85
  status: Integer,
86
86
  body: T.nilable(Object),
87
87
  request: NilClass,
88
- response: NilClass
88
+ response: NilClass,
89
+ message: T.nilable(String)
89
90
  )
90
91
  .returns(T.attached_class)
91
92
  end
92
- def self.for(url:, status:, body:, request:, response:)
93
+ def self.for(url:, status:, body:, request:, response:, message: nil)
93
94
  end
94
95
 
95
96
  sig { returns(Integer) }
@@ -0,0 +1,18 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class AddressGetParams < TerminalShop::BaseModel
6
+ extend TerminalShop::RequestParameters::Converter
7
+ include TerminalShop::RequestParameters
8
+
9
+ sig { params(request_options: T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything])).void }
10
+ def initialize(request_options: {})
11
+ end
12
+
13
+ sig { override.returns({request_options: TerminalShop::RequestOptions}) }
14
+ def to_hash
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class AddressGetResponse < TerminalShop::BaseModel
6
+ sig { returns(TerminalShop::Models::AddressAPI) }
7
+ def data
8
+ end
9
+
10
+ sig { params(_: TerminalShop::Models::AddressAPI).returns(TerminalShop::Models::AddressAPI) }
11
+ def data=(_)
12
+ end
13
+
14
+ sig { params(data: TerminalShop::Models::AddressAPI).void }
15
+ def initialize(data:)
16
+ end
17
+
18
+ sig { override.returns({data: TerminalShop::Models::AddressAPI}) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end
@@ -2,15 +2,40 @@
2
2
 
3
3
  module TerminalShop
4
4
  module Models
5
- class AppCreateParams < TerminalShop::Models::AppAPI
5
+ class AppCreateParams < TerminalShop::BaseModel
6
6
  extend TerminalShop::RequestParameters::Converter
7
7
  include TerminalShop::RequestParameters
8
8
 
9
- sig { params(request_options: T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything])).void }
10
- def initialize(request_options: {})
9
+ sig { returns(String) }
10
+ def name
11
11
  end
12
12
 
13
- sig { override.returns({request_options: TerminalShop::RequestOptions}) }
13
+ sig { params(_: String).returns(String) }
14
+ def name=(_)
15
+ end
16
+
17
+ sig { returns(String) }
18
+ def redirect_uri
19
+ end
20
+
21
+ sig { params(_: String).returns(String) }
22
+ def redirect_uri=(_)
23
+ end
24
+
25
+ sig do
26
+ params(
27
+ name: String,
28
+ redirect_uri: String,
29
+ request_options: T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything])
30
+ )
31
+ .void
32
+ end
33
+ def initialize(name:, redirect_uri:, request_options: {})
34
+ end
35
+
36
+ sig do
37
+ override.returns({name: String, redirect_uri: String, request_options: TerminalShop::RequestOptions})
38
+ end
14
39
  def to_hash
15
40
  end
16
41
  end
@@ -0,0 +1,18 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CardGetParams < TerminalShop::BaseModel
6
+ extend TerminalShop::RequestParameters::Converter
7
+ include TerminalShop::RequestParameters
8
+
9
+ sig { params(request_options: T.any(TerminalShop::RequestOptions, T::Hash[Symbol, T.anything])).void }
10
+ def initialize(request_options: {})
11
+ end
12
+
13
+ sig { override.returns({request_options: TerminalShop::RequestOptions}) }
14
+ def to_hash
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,23 @@
1
+ # typed: strong
2
+
3
+ module TerminalShop
4
+ module Models
5
+ class CardGetResponse < TerminalShop::BaseModel
6
+ sig { returns(TerminalShop::Models::CardAPI) }
7
+ def data
8
+ end
9
+
10
+ sig { params(_: TerminalShop::Models::CardAPI).returns(TerminalShop::Models::CardAPI) }
11
+ def data=(_)
12
+ end
13
+
14
+ sig { params(data: TerminalShop::Models::CardAPI).void }
15
+ def initialize(data:)
16
+ end
17
+
18
+ sig { override.returns({data: TerminalShop::Models::CardAPI}) }
19
+ def to_hash
20
+ end
21
+ end
22
+ end
23
+ end