shopify_api 12.3.0 → 12.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +40 -0
  3. data/.github/ISSUE_TEMPLATE/ENHANCEMENT.md +9 -0
  4. data/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +9 -0
  5. data/.github/workflows/build.yml +0 -3
  6. data/.github/workflows/stale.yml +1 -0
  7. data/CHANGELOG.md +8 -1
  8. data/Gemfile.lock +9 -9
  9. data/lib/shopify_api/admin_versions.rb +2 -1
  10. data/lib/shopify_api/rest/base.rb +11 -4
  11. data/lib/shopify_api/rest/resources/2022_01/assigned_fulfillment_order.rb +7 -0
  12. data/lib/shopify_api/rest/resources/2022_01/customer.rb +9 -1
  13. data/lib/shopify_api/rest/resources/2022_01/fulfillment.rb +5 -1
  14. data/lib/shopify_api/rest/resources/2022_01/fulfillment_order.rb +3 -3
  15. data/lib/shopify_api/rest/resources/2022_04/assigned_fulfillment_order.rb +7 -0
  16. data/lib/shopify_api/rest/resources/2022_04/customer.rb +9 -1
  17. data/lib/shopify_api/rest/resources/2022_04/fulfillment.rb +5 -1
  18. data/lib/shopify_api/rest/resources/2022_04/fulfillment_order.rb +3 -3
  19. data/lib/shopify_api/rest/resources/2022_04/metafield.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2022_07/assigned_fulfillment_order.rb +7 -0
  21. data/lib/shopify_api/rest/resources/2022_07/customer.rb +9 -1
  22. data/lib/shopify_api/rest/resources/2022_07/fulfillment.rb +5 -1
  23. data/lib/shopify_api/rest/resources/2022_07/fulfillment_order.rb +3 -3
  24. data/lib/shopify_api/rest/resources/2022_07/metafield.rb +5 -3
  25. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +7 -0
  26. data/lib/shopify_api/rest/resources/2022_10/customer.rb +9 -1
  27. data/lib/shopify_api/rest/resources/2022_10/fulfillment.rb +5 -1
  28. data/lib/shopify_api/rest/resources/2022_10/fulfillment_order.rb +3 -3
  29. data/lib/shopify_api/rest/resources/2022_10/metafield.rb +5 -3
  30. data/lib/shopify_api/rest/resources/2023_01/abandoned_checkout.rb +190 -0
  31. data/lib/shopify_api/rest/resources/2023_01/access_scope.rb +58 -0
  32. data/lib/shopify_api/rest/resources/2023_01/apple_pay_certificate.rb +105 -0
  33. data/lib/shopify_api/rest/resources/2023_01/application_charge.rb +104 -0
  34. data/lib/shopify_api/rest/resources/2023_01/application_credit.rb +87 -0
  35. data/lib/shopify_api/rest/resources/2023_01/article.rb +265 -0
  36. data/lib/shopify_api/rest/resources/2023_01/asset.rb +118 -0
  37. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +86 -0
  38. data/lib/shopify_api/rest/resources/2023_01/balance.rb +50 -0
  39. data/lib/shopify_api/rest/resources/2023_01/blog.rb +162 -0
  40. data/lib/shopify_api/rest/resources/2023_01/cancellation_request.rb +83 -0
  41. data/lib/shopify_api/rest/resources/2023_01/carrier_service.rb +113 -0
  42. data/lib/shopify_api/rest/resources/2023_01/checkout.rb +209 -0
  43. data/lib/shopify_api/rest/resources/2023_01/collect.rb +142 -0
  44. data/lib/shopify_api/rest/resources/2023_01/collection.rb +110 -0
  45. data/lib/shopify_api/rest/resources/2023_01/collection_listing.rb +155 -0
  46. data/lib/shopify_api/rest/resources/2023_01/comment.rb +283 -0
  47. data/lib/shopify_api/rest/resources/2023_01/country.rb +137 -0
  48. data/lib/shopify_api/rest/resources/2023_01/currency.rb +57 -0
  49. data/lib/shopify_api/rest/resources/2023_01/custom_collection.rb +187 -0
  50. data/lib/shopify_api/rest/resources/2023_01/customer.rb +329 -0
  51. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +201 -0
  52. data/lib/shopify_api/rest/resources/2023_01/customer_saved_search.rb +169 -0
  53. data/lib/shopify_api/rest/resources/2023_01/deprecated_api_call.rb +57 -0
  54. data/lib/shopify_api/rest/resources/2023_01/discount_code.rb +219 -0
  55. data/lib/shopify_api/rest/resources/2023_01/dispute.rb +111 -0
  56. data/lib/shopify_api/rest/resources/2023_01/draft_order.rb +275 -0
  57. data/lib/shopify_api/rest/resources/2023_01/event.rb +148 -0
  58. data/lib/shopify_api/rest/resources/2023_01/fulfillment.rb +225 -0
  59. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +166 -0
  60. data/lib/shopify_api/rest/resources/2023_01/fulfillment_order.rb +316 -0
  61. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +87 -0
  62. data/lib/shopify_api/rest/resources/2023_01/fulfillment_service.rb +130 -0
  63. data/lib/shopify_api/rest/resources/2023_01/gift_card.rb +215 -0
  64. data/lib/shopify_api/rest/resources/2023_01/gift_card_adjustment.rb +118 -0
  65. data/lib/shopify_api/rest/resources/2023_01/image.rb +157 -0
  66. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +108 -0
  67. data/lib/shopify_api/rest/resources/2023_01/inventory_level.rb +179 -0
  68. data/lib/shopify_api/rest/resources/2023_01/location.rb +167 -0
  69. data/lib/shopify_api/rest/resources/2023_01/locations_for_move.rb +56 -0
  70. data/lib/shopify_api/rest/resources/2023_01/marketing_event.rb +209 -0
  71. data/lib/shopify_api/rest/resources/2023_01/metafield.rb +344 -0
  72. data/lib/shopify_api/rest/resources/2023_01/mobile_platform_application.rb +110 -0
  73. data/lib/shopify_api/rest/resources/2023_01/order.rb +479 -0
  74. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +135 -0
  75. data/lib/shopify_api/rest/resources/2023_01/page.rb +194 -0
  76. data/lib/shopify_api/rest/resources/2023_01/payment.rb +140 -0
  77. data/lib/shopify_api/rest/resources/2023_01/payment_gateway.rb +143 -0
  78. data/lib/shopify_api/rest/resources/2023_01/payment_transaction.rb +107 -0
  79. data/lib/shopify_api/rest/resources/2023_01/payout.rb +97 -0
  80. data/lib/shopify_api/rest/resources/2023_01/policy.rb +69 -0
  81. data/lib/shopify_api/rest/resources/2023_01/price_rule.rb +223 -0
  82. data/lib/shopify_api/rest/resources/2023_01/product.rb +223 -0
  83. data/lib/shopify_api/rest/resources/2023_01/product_listing.rb +196 -0
  84. data/lib/shopify_api/rest/resources/2023_01/product_resource_feedback.rb +88 -0
  85. data/lib/shopify_api/rest/resources/2023_01/province.rb +132 -0
  86. data/lib/shopify_api/rest/resources/2023_01/recurring_application_charge.rb +167 -0
  87. data/lib/shopify_api/rest/resources/2023_01/redirect.rb +139 -0
  88. data/lib/shopify_api/rest/resources/2023_01/refund.rb +151 -0
  89. data/lib/shopify_api/rest/resources/2023_01/report.rb +121 -0
  90. data/lib/shopify_api/rest/resources/2023_01/resource_feedback.rb +73 -0
  91. data/lib/shopify_api/rest/resources/2023_01/script_tag.rb +155 -0
  92. data/lib/shopify_api/rest/resources/2023_01/shipping_zone.rb +83 -0
  93. data/lib/shopify_api/rest/resources/2023_01/shop.rb +221 -0
  94. data/lib/shopify_api/rest/resources/2023_01/smart_collection.rb +216 -0
  95. data/lib/shopify_api/rest/resources/2023_01/storefront_access_token.rb +87 -0
  96. data/lib/shopify_api/rest/resources/2023_01/tender_transaction.rb +93 -0
  97. data/lib/shopify_api/rest/resources/2023_01/theme.rb +120 -0
  98. data/lib/shopify_api/rest/resources/2023_01/transaction.rb +181 -0
  99. data/lib/shopify_api/rest/resources/2023_01/usage_charge.rb +97 -0
  100. data/lib/shopify_api/rest/resources/2023_01/user.rb +138 -0
  101. data/lib/shopify_api/rest/resources/2023_01/variant.rb +212 -0
  102. data/lib/shopify_api/rest/resources/2023_01/webhook.rb +168 -0
  103. data/lib/shopify_api/version.rb +1 -1
  104. metadata +78 -3
  105. data/.github/ISSUE_TEMPLATE.md +0 -35
@@ -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,167 @@
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
+ @id = T.let(nil, T.nilable(Integer))
26
+ @name = T.let(nil, T.nilable(String))
27
+ @price = T.let(nil, T.nilable(T.any(String, Float)))
28
+ @return_url = T.let(nil, T.nilable(String))
29
+ @status = T.let(nil, T.nilable(String))
30
+ @terms = T.let(nil, T.nilable(String))
31
+ @test = T.let(nil, T.nilable(T::Boolean))
32
+ @trial_days = T.let(nil, T.nilable(Integer))
33
+ @trial_ends_on = T.let(nil, T.nilable(String))
34
+ @updated_at = T.let(nil, T.nilable(String))
35
+ end
36
+
37
+ @has_one = T.let({}, T::Hash[Symbol, Class])
38
+ @has_many = T.let({}, T::Hash[Symbol, Class])
39
+ @paths = T.let([
40
+ {http_method: :delete, operation: :delete, ids: [:id], path: "recurring_application_charges/<id>.json"},
41
+ {http_method: :get, operation: :get, ids: [], path: "recurring_application_charges.json"},
42
+ {http_method: :get, operation: :get, ids: [:id], path: "recurring_application_charges/<id>.json"},
43
+ {http_method: :post, operation: :post, ids: [], path: "recurring_application_charges.json"},
44
+ {http_method: :put, operation: :customize, ids: [:id], path: "recurring_application_charges/<id>/customize.json"}
45
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
46
+
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :activated_on
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :billing_on
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :cancelled_on
53
+ sig { returns(T.nilable(T.any(String, Integer))) }
54
+ attr_reader :capped_amount
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :confirmation_url
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :created_at
59
+ sig { returns(T.nilable(Integer)) }
60
+ attr_reader :id
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :name
63
+ sig { returns(T.nilable(T.any(String, Float))) }
64
+ attr_reader :price
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :return_url
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :status
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :terms
71
+ sig { returns(T.nilable(T::Boolean)) }
72
+ attr_reader :test
73
+ sig { returns(T.nilable(Integer)) }
74
+ attr_reader :trial_days
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :trial_ends_on
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :updated_at
79
+
80
+ class << self
81
+ sig do
82
+ params(
83
+ id: T.any(Integer, String),
84
+ fields: T.untyped,
85
+ session: Auth::Session
86
+ ).returns(T.nilable(RecurringApplicationCharge))
87
+ end
88
+ def find(
89
+ id:,
90
+ fields: nil,
91
+ session: ShopifyAPI::Context.active_session
92
+ )
93
+ result = base_find(
94
+ session: session,
95
+ ids: {id: id},
96
+ params: {fields: fields},
97
+ )
98
+ T.cast(result[0], T.nilable(RecurringApplicationCharge))
99
+ end
100
+
101
+ sig do
102
+ params(
103
+ id: T.any(Integer, String),
104
+ session: Auth::Session
105
+ ).returns(T.untyped)
106
+ end
107
+ def delete(
108
+ id:,
109
+ session: ShopifyAPI::Context.active_session
110
+ )
111
+ request(
112
+ http_method: :delete,
113
+ operation: :delete,
114
+ session: session,
115
+ ids: {id: id},
116
+ params: {},
117
+ )
118
+ end
119
+
120
+ sig do
121
+ params(
122
+ since_id: T.untyped,
123
+ fields: T.untyped,
124
+ session: Auth::Session,
125
+ kwargs: T.untyped
126
+ ).returns(T::Array[RecurringApplicationCharge])
127
+ end
128
+ def all(
129
+ since_id: nil,
130
+ fields: nil,
131
+ session: ShopifyAPI::Context.active_session,
132
+ **kwargs
133
+ )
134
+ response = base_find(
135
+ session: session,
136
+ ids: {},
137
+ params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
138
+ )
139
+
140
+ T.cast(response, T::Array[RecurringApplicationCharge])
141
+ end
142
+
143
+ end
144
+
145
+ sig do
146
+ params(
147
+ body: T.untyped,
148
+ kwargs: T.untyped
149
+ ).returns(T.untyped)
150
+ end
151
+ def customize(
152
+ body: nil,
153
+ **kwargs
154
+ )
155
+ self.class.request(
156
+ http_method: :put,
157
+ operation: :customize,
158
+ session: @session,
159
+ ids: {id: @id},
160
+ params: {}.merge(kwargs).compact,
161
+ body: body,
162
+ entity: self,
163
+ )
164
+ end
165
+
166
+ end
167
+ end