shopify_api 12.5.0 → 13.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/CHANGELOG.md +7 -0
  4. data/Gemfile.lock +2 -2
  5. data/lib/shopify_api/auth/oauth.rb +0 -2
  6. data/lib/shopify_api/clients/http_client.rb +13 -9
  7. data/lib/shopify_api/context.rb +4 -20
  8. data/lib/shopify_api/rest/base.rb +48 -14
  9. data/lib/shopify_api/rest/resources/2022_04/abandoned_checkout.rb +190 -0
  10. data/lib/shopify_api/rest/resources/2022_04/access_scope.rb +58 -0
  11. data/lib/shopify_api/rest/resources/2022_04/android_pay_key.rb +77 -0
  12. data/lib/shopify_api/rest/resources/2022_04/apple_pay_certificate.rb +105 -0
  13. data/lib/shopify_api/rest/resources/2022_04/application_charge.rb +109 -0
  14. data/lib/shopify_api/rest/resources/2022_04/application_credit.rb +92 -0
  15. data/lib/shopify_api/rest/resources/2022_04/article.rb +265 -0
  16. data/lib/shopify_api/rest/resources/2022_04/asset.rb +118 -0
  17. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +86 -0
  18. data/lib/shopify_api/rest/resources/2022_04/balance.rb +50 -0
  19. data/lib/shopify_api/rest/resources/2022_04/blog.rb +162 -0
  20. data/lib/shopify_api/rest/resources/2022_04/cancellation_request.rb +83 -0
  21. data/lib/shopify_api/rest/resources/2022_04/carrier_service.rb +116 -0
  22. data/lib/shopify_api/rest/resources/2022_04/checkout.rb +209 -0
  23. data/lib/shopify_api/rest/resources/2022_04/collect.rb +142 -0
  24. data/lib/shopify_api/rest/resources/2022_04/collection.rb +110 -0
  25. data/lib/shopify_api/rest/resources/2022_04/collection_listing.rb +155 -0
  26. data/lib/shopify_api/rest/resources/2022_04/comment.rb +283 -0
  27. data/lib/shopify_api/rest/resources/2022_04/country.rb +137 -0
  28. data/lib/shopify_api/rest/resources/2022_04/currency.rb +57 -0
  29. data/lib/shopify_api/rest/resources/2022_04/custom_collection.rb +187 -0
  30. data/lib/shopify_api/rest/resources/2022_04/customer.rb +329 -0
  31. data/lib/shopify_api/rest/resources/2022_04/customer_address.rb +201 -0
  32. data/lib/shopify_api/rest/resources/2022_04/customer_saved_search.rb +169 -0
  33. data/lib/shopify_api/rest/resources/2022_04/deprecated_api_call.rb +57 -0
  34. data/lib/shopify_api/rest/resources/2022_04/discount_code.rb +222 -0
  35. data/lib/shopify_api/rest/resources/2022_04/dispute.rb +111 -0
  36. data/lib/shopify_api/rest/resources/2022_04/draft_order.rb +275 -0
  37. data/lib/shopify_api/rest/resources/2022_04/event.rb +148 -0
  38. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +278 -0
  39. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +166 -0
  40. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +284 -0
  41. data/lib/shopify_api/rest/resources/2022_04/fulfillment_request.rb +87 -0
  42. data/lib/shopify_api/rest/resources/2022_04/fulfillment_service.rb +130 -0
  43. data/lib/shopify_api/rest/resources/2022_04/gift_card.rb +218 -0
  44. data/lib/shopify_api/rest/resources/2022_04/gift_card_adjustment.rb +118 -0
  45. data/lib/shopify_api/rest/resources/2022_04/image.rb +157 -0
  46. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +108 -0
  47. data/lib/shopify_api/rest/resources/2022_04/inventory_level.rb +179 -0
  48. data/lib/shopify_api/rest/resources/2022_04/location.rb +167 -0
  49. data/lib/shopify_api/rest/resources/2022_04/locations_for_move.rb +56 -0
  50. data/lib/shopify_api/rest/resources/2022_04/marketing_event.rb +209 -0
  51. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +344 -0
  52. data/lib/shopify_api/rest/resources/2022_04/mobile_platform_application.rb +110 -0
  53. data/lib/shopify_api/rest/resources/2022_04/order.rb +473 -0
  54. data/lib/shopify_api/rest/resources/2022_04/order_risk.rb +142 -0
  55. data/lib/shopify_api/rest/resources/2022_04/page.rb +194 -0
  56. data/lib/shopify_api/rest/resources/2022_04/payment.rb +140 -0
  57. data/lib/shopify_api/rest/resources/2022_04/payment_gateway.rb +143 -0
  58. data/lib/shopify_api/rest/resources/2022_04/payment_transaction.rb +107 -0
  59. data/lib/shopify_api/rest/resources/2022_04/payout.rb +97 -0
  60. data/lib/shopify_api/rest/resources/2022_04/policy.rb +69 -0
  61. data/lib/shopify_api/rest/resources/2022_04/price_rule.rb +223 -0
  62. data/lib/shopify_api/rest/resources/2022_04/product.rb +223 -0
  63. data/lib/shopify_api/rest/resources/2022_04/product_listing.rb +196 -0
  64. data/lib/shopify_api/rest/resources/2022_04/product_resource_feedback.rb +88 -0
  65. data/lib/shopify_api/rest/resources/2022_04/province.rb +132 -0
  66. data/lib/shopify_api/rest/resources/2022_04/recurring_application_charge.rb +172 -0
  67. data/lib/shopify_api/rest/resources/2022_04/redirect.rb +139 -0
  68. data/lib/shopify_api/rest/resources/2022_04/refund.rb +151 -0
  69. data/lib/shopify_api/rest/resources/2022_04/report.rb +121 -0
  70. data/lib/shopify_api/rest/resources/2022_04/resource_feedback.rb +73 -0
  71. data/lib/shopify_api/rest/resources/2022_04/script_tag.rb +155 -0
  72. data/lib/shopify_api/rest/resources/2022_04/shipping_zone.rb +83 -0
  73. data/lib/shopify_api/rest/resources/2022_04/shop.rb +218 -0
  74. data/lib/shopify_api/rest/resources/2022_04/smart_collection.rb +216 -0
  75. data/lib/shopify_api/rest/resources/2022_04/storefront_access_token.rb +87 -0
  76. data/lib/shopify_api/rest/resources/2022_04/tender_transaction.rb +93 -0
  77. data/lib/shopify_api/rest/resources/2022_04/theme.rb +123 -0
  78. data/lib/shopify_api/rest/resources/2022_04/transaction.rb +181 -0
  79. data/lib/shopify_api/rest/resources/2022_04/usage_charge.rb +102 -0
  80. data/lib/shopify_api/rest/resources/2022_04/user.rb +138 -0
  81. data/lib/shopify_api/rest/resources/2022_04/variant.rb +212 -0
  82. data/lib/shopify_api/rest/resources/2022_04/webhook.rb +168 -0
  83. data/lib/shopify_api/rest/resources/2022_07/application_credit.rb +2 -2
  84. data/lib/shopify_api/rest/resources/2022_07/carrier_service.rb +3 -0
  85. data/lib/shopify_api/rest/resources/2022_07/discount_code.rb +3 -0
  86. data/lib/shopify_api/rest/resources/2022_07/dispute.rb +2 -2
  87. data/lib/shopify_api/rest/resources/2022_07/draft_order.rb +2 -2
  88. data/lib/shopify_api/rest/resources/2022_07/event.rb +2 -2
  89. data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +6 -0
  90. data/lib/shopify_api/rest/resources/2022_07/gift_card.rb +8 -5
  91. data/lib/shopify_api/rest/resources/2022_07/order_risk.rb +9 -2
  92. data/lib/shopify_api/rest/resources/2022_07/shipping_zone.rb +2 -2
  93. data/lib/shopify_api/rest/resources/2022_07/shop.rb +2 -2
  94. data/lib/shopify_api/rest/resources/2022_07/theme.rb +3 -0
  95. data/lib/shopify_api/rest/resources/2022_07/usage_charge.rb +2 -2
  96. data/lib/shopify_api/rest/resources/2022_10/application_credit.rb +2 -2
  97. data/lib/shopify_api/rest/resources/2022_10/carrier_service.rb +3 -0
  98. data/lib/shopify_api/rest/resources/2022_10/discount_code.rb +3 -0
  99. data/lib/shopify_api/rest/resources/2022_10/dispute.rb +2 -2
  100. data/lib/shopify_api/rest/resources/2022_10/draft_order.rb +2 -2
  101. data/lib/shopify_api/rest/resources/2022_10/event.rb +2 -2
  102. data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +6 -0
  103. data/lib/shopify_api/rest/resources/2022_10/gift_card.rb +8 -5
  104. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +9 -2
  105. data/lib/shopify_api/rest/resources/2022_10/shipping_zone.rb +2 -2
  106. data/lib/shopify_api/rest/resources/2022_10/shop.rb +2 -2
  107. data/lib/shopify_api/rest/resources/2022_10/theme.rb +3 -0
  108. data/lib/shopify_api/rest/resources/2022_10/usage_charge.rb +2 -2
  109. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +2 -2
  110. data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +3 -0
  111. data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +3 -0
  112. data/lib/shopify_api/rest/resources/2023_01/dispute.rb +2 -2
  113. data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +2 -2
  114. data/lib/shopify_api/rest/resources/2023_01/event.rb +2 -2
  115. data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +6 -0
  116. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +8 -5
  117. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +9 -2
  118. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +2 -2
  119. data/lib/shopify_api/rest/resources/2023_01/shop.rb +2 -2
  120. data/lib/shopify_api/rest/resources/2023_01/theme.rb +3 -0
  121. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +2 -2
  122. data/lib/shopify_api/rest/resources/2023_04/application_credit.rb +2 -2
  123. data/lib/shopify_api/rest/resources/2023_04/carrier_service.rb +3 -0
  124. data/lib/shopify_api/rest/resources/2023_04/discount_code.rb +3 -0
  125. data/lib/shopify_api/rest/resources/2023_04/dispute.rb +2 -2
  126. data/lib/shopify_api/rest/resources/2023_04/draft_order.rb +2 -2
  127. data/lib/shopify_api/rest/resources/2023_04/event.rb +2 -2
  128. data/lib/shopify_api/rest/resources/2023_04/fulfillment.rb +6 -0
  129. data/lib/shopify_api/rest/resources/2023_04/gift_card.rb +8 -5
  130. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +9 -2
  131. data/lib/shopify_api/rest/resources/2023_04/shipping_zone.rb +2 -2
  132. data/lib/shopify_api/rest/resources/2023_04/shop.rb +2 -2
  133. data/lib/shopify_api/rest/resources/2023_04/theme.rb +3 -0
  134. data/lib/shopify_api/rest/resources/2023_04/usage_charge.rb +2 -2
  135. data/lib/shopify_api/utils/graphql_proxy.rb +3 -6
  136. data/lib/shopify_api/utils/session_utils.rb +0 -84
  137. data/lib/shopify_api/version.rb +1 -1
  138. data/lib/shopify_api/webhooks/registry.rb +1 -1
  139. metadata +77 -5
  140. data/lib/shopify_api/auth/file_session_storage.rb +0 -72
  141. data/lib/shopify_api/auth/session_storage.rb +0 -30
@@ -0,0 +1,196 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class ProductListing < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @body_html = T.let(nil, T.nilable(String))
20
+ @created_at = T.let(nil, T.nilable(String))
21
+ @handle = T.let(nil, T.nilable(String))
22
+ @images = T.let(nil, T.nilable(T::Array[T.untyped]))
23
+ @options = T.let(nil, T.nilable(T::Array[T.untyped]))
24
+ @product_id = T.let(nil, T.nilable(Integer))
25
+ @product_type = T.let(nil, T.nilable(String))
26
+ @published_at = T.let(nil, T.nilable(String))
27
+ @tags = T.let(nil, T.nilable(String))
28
+ @title = T.let(nil, T.nilable(String))
29
+ @updated_at = T.let(nil, T.nilable(String))
30
+ @variants = T.let(nil, T.nilable(T::Array[T.untyped]))
31
+ @vendor = T.let(nil, T.nilable(String))
32
+ end
33
+
34
+ @has_one = T.let({}, T::Hash[Symbol, Class])
35
+ @has_many = T.let({
36
+ images: Image,
37
+ variants: Variant
38
+ }, T::Hash[Symbol, Class])
39
+ @paths = T.let([
40
+ {http_method: :delete, operation: :delete, ids: [:product_id], path: "product_listings/<product_id>.json"},
41
+ {http_method: :get, operation: :count, ids: [], path: "product_listings/count.json"},
42
+ {http_method: :get, operation: :get, ids: [], path: "product_listings.json"},
43
+ {http_method: :get, operation: :get, ids: [:product_id], path: "product_listings/<product_id>.json"},
44
+ {http_method: :get, operation: :product_ids, ids: [], path: "product_listings/product_ids.json"},
45
+ {http_method: :put, operation: :put, ids: [:product_id], path: "product_listings/<product_id>.json"}
46
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
47
+
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :body_html
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :created_at
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :handle
54
+ sig { returns(T.nilable(T::Array[Image])) }
55
+ attr_reader :images
56
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
57
+ attr_reader :options
58
+ sig { returns(T.nilable(Integer)) }
59
+ attr_reader :product_id
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :product_type
62
+ sig { returns(T.nilable(String)) }
63
+ attr_reader :published_at
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :tags
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :title
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :updated_at
70
+ sig { returns(T.nilable(T::Array[Variant])) }
71
+ attr_reader :variants
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :vendor
74
+
75
+ class << self
76
+ sig do
77
+ returns(String)
78
+ end
79
+ def primary_key()
80
+ "product_id"
81
+ end
82
+
83
+ sig do
84
+ params(
85
+ product_id: T.any(Integer, String),
86
+ session: Auth::Session
87
+ ).returns(T.nilable(ProductListing))
88
+ end
89
+ def find(
90
+ product_id:,
91
+ session: ShopifyAPI::Context.active_session
92
+ )
93
+ result = base_find(
94
+ session: session,
95
+ ids: {product_id: product_id},
96
+ params: {},
97
+ )
98
+ T.cast(result[0], T.nilable(ProductListing))
99
+ end
100
+
101
+ sig do
102
+ params(
103
+ product_id: T.any(Integer, String),
104
+ session: Auth::Session
105
+ ).returns(T.untyped)
106
+ end
107
+ def delete(
108
+ product_id:,
109
+ session: ShopifyAPI::Context.active_session
110
+ )
111
+ request(
112
+ http_method: :delete,
113
+ operation: :delete,
114
+ session: session,
115
+ ids: {product_id: product_id},
116
+ params: {},
117
+ )
118
+ end
119
+
120
+ sig do
121
+ params(
122
+ product_ids: T.untyped,
123
+ limit: T.untyped,
124
+ collection_id: T.untyped,
125
+ updated_at_min: T.untyped,
126
+ handle: T.untyped,
127
+ session: Auth::Session,
128
+ kwargs: T.untyped
129
+ ).returns(T::Array[ProductListing])
130
+ end
131
+ def all(
132
+ product_ids: nil,
133
+ limit: nil,
134
+ collection_id: nil,
135
+ updated_at_min: nil,
136
+ handle: nil,
137
+ session: ShopifyAPI::Context.active_session,
138
+ **kwargs
139
+ )
140
+ response = base_find(
141
+ session: session,
142
+ ids: {},
143
+ params: {product_ids: product_ids, limit: limit, collection_id: collection_id, updated_at_min: updated_at_min, handle: handle}.merge(kwargs).compact,
144
+ )
145
+
146
+ T.cast(response, T::Array[ProductListing])
147
+ end
148
+
149
+ sig do
150
+ params(
151
+ session: Auth::Session,
152
+ kwargs: T.untyped
153
+ ).returns(T.untyped)
154
+ end
155
+ def count(
156
+ session: ShopifyAPI::Context.active_session,
157
+ **kwargs
158
+ )
159
+ request(
160
+ http_method: :get,
161
+ operation: :count,
162
+ session: session,
163
+ ids: {},
164
+ params: {}.merge(kwargs).compact,
165
+ body: {},
166
+ entity: nil,
167
+ )
168
+ end
169
+
170
+ sig do
171
+ params(
172
+ limit: T.untyped,
173
+ session: Auth::Session,
174
+ kwargs: T.untyped
175
+ ).returns(T.untyped)
176
+ end
177
+ def product_ids(
178
+ limit: nil,
179
+ session: ShopifyAPI::Context.active_session,
180
+ **kwargs
181
+ )
182
+ request(
183
+ http_method: :get,
184
+ operation: :product_ids,
185
+ session: session,
186
+ ids: {},
187
+ params: {limit: limit}.merge(kwargs).compact,
188
+ body: {},
189
+ entity: nil,
190
+ )
191
+ end
192
+
193
+ end
194
+
195
+ end
196
+ end
@@ -0,0 +1,88 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class ProductResourceFeedback < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @created_at = T.let(nil, T.nilable(String))
20
+ @feedback_generated_at = T.let(nil, T.nilable(String))
21
+ @messages = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @product_id = T.let(nil, T.nilable(Integer))
23
+ @resource_id = T.let(nil, T.nilable(Integer))
24
+ @resource_type = T.let(nil, T.nilable(String))
25
+ @resource_updated_at = T.let(nil, T.nilable(String))
26
+ @state = T.let(nil, T.nilable(String))
27
+ @updated_at = T.let(nil, T.nilable(String))
28
+ end
29
+
30
+ @has_one = T.let({}, T::Hash[Symbol, Class])
31
+ @has_many = T.let({}, T::Hash[Symbol, Class])
32
+ @paths = T.let([
33
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/resource_feedback.json"},
34
+ {http_method: :post, operation: :post, ids: [:product_id], path: "products/<product_id>/resource_feedback.json"}
35
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
36
+
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :created_at
39
+ sig { returns(T.nilable(String)) }
40
+ attr_reader :feedback_generated_at
41
+ sig { returns(T.nilable(T::Array[String])) }
42
+ attr_reader :messages
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_reader :product_id
45
+ sig { returns(T.nilable(Integer)) }
46
+ attr_reader :resource_id
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :resource_type
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :resource_updated_at
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :state
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :updated_at
55
+
56
+ class << self
57
+ sig do
58
+ returns(String)
59
+ end
60
+ def json_body_name()
61
+ "resource_feedback"
62
+ end
63
+
64
+ sig do
65
+ params(
66
+ product_id: T.nilable(T.any(Integer, String)),
67
+ session: Auth::Session,
68
+ kwargs: T.untyped
69
+ ).returns(T::Array[ProductResourceFeedback])
70
+ end
71
+ def all(
72
+ product_id: nil,
73
+ session: ShopifyAPI::Context.active_session,
74
+ **kwargs
75
+ )
76
+ response = base_find(
77
+ session: session,
78
+ ids: {product_id: product_id},
79
+ params: {}.merge(kwargs).compact,
80
+ )
81
+
82
+ T.cast(response, T::Array[ProductResourceFeedback])
83
+ end
84
+
85
+ end
86
+
87
+ end
88
+ end
@@ -0,0 +1,132 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class Province < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @code = T.let(nil, T.nilable(String))
20
+ @country_id = T.let(nil, T.nilable(Integer))
21
+ @id = T.let(nil, T.nilable(Integer))
22
+ @name = T.let(nil, T.nilable(String))
23
+ @shipping_zone_id = T.let(nil, T.nilable(Integer))
24
+ @tax = T.let(nil, T.nilable(Float))
25
+ @tax_name = T.let(nil, T.nilable(String))
26
+ @tax_percentage = T.let(nil, T.nilable(Float))
27
+ @tax_type = T.let(nil, T.nilable(String))
28
+ end
29
+
30
+ @has_one = T.let({}, T::Hash[Symbol, Class])
31
+ @has_many = T.let({}, T::Hash[Symbol, Class])
32
+ @paths = T.let([
33
+ {http_method: :get, operation: :count, ids: [:country_id], path: "countries/<country_id>/provinces/count.json"},
34
+ {http_method: :get, operation: :get, ids: [:country_id], path: "countries/<country_id>/provinces.json"},
35
+ {http_method: :get, operation: :get, ids: [:country_id, :id], path: "countries/<country_id>/provinces/<id>.json"},
36
+ {http_method: :put, operation: :put, ids: [:country_id, :id], path: "countries/<country_id>/provinces/<id>.json"}
37
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
38
+
39
+ sig { returns(T.nilable(String)) }
40
+ attr_reader :code
41
+ sig { returns(T.nilable(Integer)) }
42
+ attr_reader :country_id
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_reader :id
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :name
47
+ sig { returns(T.nilable(Integer)) }
48
+ attr_reader :shipping_zone_id
49
+ sig { returns(T.nilable(Float)) }
50
+ attr_reader :tax
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :tax_name
53
+ sig { returns(T.nilable(Float)) }
54
+ attr_reader :tax_percentage
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :tax_type
57
+
58
+ class << self
59
+ sig do
60
+ params(
61
+ id: T.any(Integer, String),
62
+ country_id: T.nilable(T.any(Integer, String)),
63
+ fields: T.untyped,
64
+ session: Auth::Session
65
+ ).returns(T.nilable(Province))
66
+ end
67
+ def find(
68
+ id:,
69
+ country_id: nil,
70
+ fields: nil,
71
+ session: ShopifyAPI::Context.active_session
72
+ )
73
+ result = base_find(
74
+ session: session,
75
+ ids: {id: id, country_id: country_id},
76
+ params: {fields: fields},
77
+ )
78
+ T.cast(result[0], T.nilable(Province))
79
+ end
80
+
81
+ sig do
82
+ params(
83
+ country_id: T.nilable(T.any(Integer, String)),
84
+ since_id: T.untyped,
85
+ fields: T.untyped,
86
+ session: Auth::Session,
87
+ kwargs: T.untyped
88
+ ).returns(T::Array[Province])
89
+ end
90
+ def all(
91
+ country_id: nil,
92
+ since_id: nil,
93
+ fields: nil,
94
+ session: ShopifyAPI::Context.active_session,
95
+ **kwargs
96
+ )
97
+ response = base_find(
98
+ session: session,
99
+ ids: {country_id: country_id},
100
+ params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
101
+ )
102
+
103
+ T.cast(response, T::Array[Province])
104
+ end
105
+
106
+ sig do
107
+ params(
108
+ country_id: T.nilable(T.any(Integer, String)),
109
+ session: Auth::Session,
110
+ kwargs: T.untyped
111
+ ).returns(T.untyped)
112
+ end
113
+ def count(
114
+ country_id: nil,
115
+ session: ShopifyAPI::Context.active_session,
116
+ **kwargs
117
+ )
118
+ request(
119
+ http_method: :get,
120
+ operation: :count,
121
+ session: session,
122
+ ids: {country_id: country_id},
123
+ params: {}.merge(kwargs).compact,
124
+ body: {},
125
+ entity: nil,
126
+ )
127
+ end
128
+
129
+ end
130
+
131
+ end
132
+ end
@@ -0,0 +1,172 @@
1
+ # typed: false
2
+ # frozen_string_literal: true
3
+
4
+ ########################################################################################################################
5
+ # This file is auto-generated. If you have an issue, please create a GitHub issue. #
6
+ ########################################################################################################################
7
+
8
+ module ShopifyAPI
9
+ class RecurringApplicationCharge < ShopifyAPI::Rest::Base
10
+ extend T::Sig
11
+
12
+ @prev_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
13
+ @next_page_info = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
14
+
15
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session)).void }
16
+ def initialize(session: ShopifyAPI::Context.active_session)
17
+ super(session: session)
18
+
19
+ @activated_on = T.let(nil, T.nilable(String))
20
+ @billing_on = T.let(nil, T.nilable(String))
21
+ @cancelled_on = T.let(nil, T.nilable(String))
22
+ @capped_amount = T.let(nil, T.nilable(T.any(String, Integer)))
23
+ @confirmation_url = T.let(nil, T.nilable(String))
24
+ @created_at = T.let(nil, T.nilable(String))
25
+ @currency = T.let(nil, T.nilable(Currency))
26
+ @id = T.let(nil, T.nilable(Integer))
27
+ @name = T.let(nil, T.nilable(String))
28
+ @price = T.let(nil, T.nilable(T.any(String, Float)))
29
+ @return_url = T.let(nil, T.nilable(String))
30
+ @status = T.let(nil, T.nilable(String))
31
+ @terms = T.let(nil, T.nilable(String))
32
+ @test = T.let(nil, T.nilable(T::Boolean))
33
+ @trial_days = T.let(nil, T.nilable(Integer))
34
+ @trial_ends_on = T.let(nil, T.nilable(String))
35
+ @updated_at = T.let(nil, T.nilable(String))
36
+ end
37
+
38
+ @has_one = T.let({
39
+ currency: Currency
40
+ }, T::Hash[Symbol, Class])
41
+ @has_many = T.let({}, T::Hash[Symbol, Class])
42
+ @paths = T.let([
43
+ {http_method: :delete, operation: :delete, ids: [:id], path: "recurring_application_charges/<id>.json"},
44
+ {http_method: :get, operation: :get, ids: [], path: "recurring_application_charges.json"},
45
+ {http_method: :get, operation: :get, ids: [:id], path: "recurring_application_charges/<id>.json"},
46
+ {http_method: :post, operation: :post, ids: [], path: "recurring_application_charges.json"},
47
+ {http_method: :put, operation: :customize, ids: [:id], path: "recurring_application_charges/<id>/customize.json"}
48
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
49
+
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :activated_on
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :billing_on
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :cancelled_on
56
+ sig { returns(T.nilable(T.any(String, Integer))) }
57
+ attr_reader :capped_amount
58
+ sig { returns(T.nilable(String)) }
59
+ attr_reader :confirmation_url
60
+ sig { returns(T.nilable(String)) }
61
+ attr_reader :created_at
62
+ sig { returns(T.nilable(Currency)) }
63
+ attr_reader :currency
64
+ sig { returns(T.nilable(Integer)) }
65
+ attr_reader :id
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :name
68
+ sig { returns(T.nilable(T.any(String, Float))) }
69
+ attr_reader :price
70
+ sig { returns(T.nilable(String)) }
71
+ attr_reader :return_url
72
+ sig { returns(T.nilable(String)) }
73
+ attr_reader :status
74
+ sig { returns(T.nilable(String)) }
75
+ attr_reader :terms
76
+ sig { returns(T.nilable(T::Boolean)) }
77
+ attr_reader :test
78
+ sig { returns(T.nilable(Integer)) }
79
+ attr_reader :trial_days
80
+ sig { returns(T.nilable(String)) }
81
+ attr_reader :trial_ends_on
82
+ sig { returns(T.nilable(String)) }
83
+ attr_reader :updated_at
84
+
85
+ class << self
86
+ sig do
87
+ params(
88
+ id: T.any(Integer, String),
89
+ fields: T.untyped,
90
+ session: Auth::Session
91
+ ).returns(T.nilable(RecurringApplicationCharge))
92
+ end
93
+ def find(
94
+ id:,
95
+ fields: nil,
96
+ session: ShopifyAPI::Context.active_session
97
+ )
98
+ result = base_find(
99
+ session: session,
100
+ ids: {id: id},
101
+ params: {fields: fields},
102
+ )
103
+ T.cast(result[0], T.nilable(RecurringApplicationCharge))
104
+ end
105
+
106
+ sig do
107
+ params(
108
+ id: T.any(Integer, String),
109
+ session: Auth::Session
110
+ ).returns(T.untyped)
111
+ end
112
+ def delete(
113
+ id:,
114
+ session: ShopifyAPI::Context.active_session
115
+ )
116
+ request(
117
+ http_method: :delete,
118
+ operation: :delete,
119
+ session: session,
120
+ ids: {id: id},
121
+ params: {},
122
+ )
123
+ end
124
+
125
+ sig do
126
+ params(
127
+ since_id: T.untyped,
128
+ fields: T.untyped,
129
+ session: Auth::Session,
130
+ kwargs: T.untyped
131
+ ).returns(T::Array[RecurringApplicationCharge])
132
+ end
133
+ def all(
134
+ since_id: nil,
135
+ fields: nil,
136
+ session: ShopifyAPI::Context.active_session,
137
+ **kwargs
138
+ )
139
+ response = base_find(
140
+ session: session,
141
+ ids: {},
142
+ params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
143
+ )
144
+
145
+ T.cast(response, T::Array[RecurringApplicationCharge])
146
+ end
147
+
148
+ end
149
+
150
+ sig do
151
+ params(
152
+ body: T.untyped,
153
+ kwargs: T.untyped
154
+ ).returns(T.untyped)
155
+ end
156
+ def customize(
157
+ body: nil,
158
+ **kwargs
159
+ )
160
+ self.class.request(
161
+ http_method: :put,
162
+ operation: :customize,
163
+ session: @session,
164
+ ids: {id: @id},
165
+ params: {}.merge(kwargs).compact,
166
+ body: body,
167
+ entity: self,
168
+ )
169
+ end
170
+
171
+ end
172
+ end