shopify_api 13.1.0 → 13.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/BREAKING_CHANGES_FOR_V10.md +231 -0
  3. data/CHANGELOG.md +8 -1
  4. data/Gemfile.lock +5 -5
  5. data/README.md +10 -34
  6. data/docs/README.md +0 -1
  7. data/docs/getting_started.md +20 -3
  8. data/docs/usage/custom_apps.md +75 -0
  9. data/docs/usage/graphql.md +63 -18
  10. data/docs/usage/oauth.md +160 -27
  11. data/docs/usage/rest.md +204 -62
  12. data/docs/usage/webhooks.md +22 -4
  13. data/lib/shopify_api/admin_versions.rb +2 -1
  14. data/lib/shopify_api/context.rb +5 -3
  15. data/lib/shopify_api/rest/base.rb +22 -14
  16. data/lib/shopify_api/rest/resources/2022_10/assigned_fulfillment_order.rb +5 -3
  17. data/lib/shopify_api/rest/resources/2022_10/customer_address.rb +10 -0
  18. data/lib/shopify_api/rest/resources/2022_10/fulfillment_request.rb +10 -0
  19. data/lib/shopify_api/rest/resources/2022_10/order_risk.rb +5 -3
  20. data/lib/shopify_api/rest/resources/2023_01/assigned_fulfillment_order.rb +5 -3
  21. data/lib/shopify_api/rest/resources/2023_01/balance.rb +4 -0
  22. data/lib/shopify_api/rest/resources/2023_01/customer_address.rb +10 -0
  23. data/lib/shopify_api/rest/resources/2023_01/fulfillment_request.rb +10 -0
  24. data/lib/shopify_api/rest/resources/2023_01/order.rb +3 -0
  25. data/lib/shopify_api/rest/resources/2023_01/order_risk.rb +5 -3
  26. data/lib/shopify_api/rest/resources/2023_01/shop.rb +0 -3
  27. data/lib/shopify_api/rest/resources/2023_01/variant.rb +1 -5
  28. data/lib/shopify_api/rest/resources/2023_04/assigned_fulfillment_order.rb +5 -3
  29. data/lib/shopify_api/rest/resources/2023_04/balance.rb +4 -0
  30. data/lib/shopify_api/rest/resources/2023_04/customer_address.rb +10 -0
  31. data/lib/shopify_api/rest/resources/2023_04/fulfillment_request.rb +10 -0
  32. data/lib/shopify_api/rest/resources/2023_04/order.rb +3 -0
  33. data/lib/shopify_api/rest/resources/2023_04/order_risk.rb +5 -3
  34. data/lib/shopify_api/rest/resources/2023_04/shop.rb +0 -3
  35. data/lib/shopify_api/rest/resources/2023_04/variant.rb +1 -5
  36. data/lib/shopify_api/rest/resources/2023_07/assigned_fulfillment_order.rb +5 -3
  37. data/lib/shopify_api/rest/resources/2023_07/balance.rb +4 -0
  38. data/lib/shopify_api/rest/resources/2023_07/customer_address.rb +10 -0
  39. data/lib/shopify_api/rest/resources/2023_07/fulfillment_request.rb +10 -0
  40. data/lib/shopify_api/rest/resources/2023_07/order.rb +3 -0
  41. data/lib/shopify_api/rest/resources/2023_07/order_risk.rb +5 -3
  42. data/lib/shopify_api/rest/resources/2023_07/report.rb +121 -0
  43. data/lib/shopify_api/rest/resources/2023_07/shop.rb +0 -3
  44. data/lib/shopify_api/rest/resources/2023_07/variant.rb +1 -5
  45. data/lib/shopify_api/rest/resources/2023_10/abandoned_checkout.rb +190 -0
  46. data/lib/shopify_api/rest/resources/2023_10/access_scope.rb +58 -0
  47. data/lib/shopify_api/rest/resources/2023_10/apple_pay_certificate.rb +105 -0
  48. data/lib/shopify_api/rest/resources/2023_10/application_charge.rb +109 -0
  49. data/lib/shopify_api/rest/resources/2023_10/application_credit.rb +91 -0
  50. data/lib/shopify_api/rest/resources/2023_10/article.rb +265 -0
  51. data/lib/shopify_api/rest/resources/2023_10/asset.rb +118 -0
  52. data/lib/shopify_api/rest/resources/2023_10/assigned_fulfillment_order.rb +88 -0
  53. data/lib/shopify_api/rest/resources/2023_10/balance.rb +54 -0
  54. data/lib/shopify_api/rest/resources/2023_10/blog.rb +162 -0
  55. data/lib/shopify_api/rest/resources/2023_10/cancellation_request.rb +83 -0
  56. data/lib/shopify_api/rest/resources/2023_10/carrier_service.rb +116 -0
  57. data/lib/shopify_api/rest/resources/2023_10/checkout.rb +209 -0
  58. data/lib/shopify_api/rest/resources/2023_10/collect.rb +142 -0
  59. data/lib/shopify_api/rest/resources/2023_10/collection.rb +110 -0
  60. data/lib/shopify_api/rest/resources/2023_10/collection_listing.rb +155 -0
  61. data/lib/shopify_api/rest/resources/2023_10/comment.rb +283 -0
  62. data/lib/shopify_api/rest/resources/2023_10/country.rb +137 -0
  63. data/lib/shopify_api/rest/resources/2023_10/currency.rb +57 -0
  64. data/lib/shopify_api/rest/resources/2023_10/custom_collection.rb +187 -0
  65. data/lib/shopify_api/rest/resources/2023_10/customer.rb +329 -0
  66. data/lib/shopify_api/rest/resources/2023_10/customer_address.rb +211 -0
  67. data/lib/shopify_api/rest/resources/2023_10/deprecated_api_call.rb +57 -0
  68. data/lib/shopify_api/rest/resources/2023_10/discount_code.rb +222 -0
  69. data/lib/shopify_api/rest/resources/2023_10/dispute.rb +111 -0
  70. data/lib/shopify_api/rest/resources/2023_10/dispute_evidence.rb +117 -0
  71. data/lib/shopify_api/rest/resources/2023_10/dispute_file_upload.rb +81 -0
  72. data/lib/shopify_api/rest/resources/2023_10/draft_order.rb +275 -0
  73. data/lib/shopify_api/rest/resources/2023_10/event.rb +148 -0
  74. data/lib/shopify_api/rest/resources/2023_10/fulfillment.rb +231 -0
  75. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +166 -0
  76. data/lib/shopify_api/rest/resources/2023_10/fulfillment_order.rb +312 -0
  77. data/lib/shopify_api/rest/resources/2023_10/fulfillment_request.rb +97 -0
  78. data/lib/shopify_api/rest/resources/2023_10/fulfillment_service.rb +130 -0
  79. data/lib/shopify_api/rest/resources/2023_10/gift_card.rb +218 -0
  80. data/lib/shopify_api/rest/resources/2023_10/gift_card_adjustment.rb +118 -0
  81. data/lib/shopify_api/rest/resources/2023_10/image.rb +157 -0
  82. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +108 -0
  83. data/lib/shopify_api/rest/resources/2023_10/inventory_level.rb +179 -0
  84. data/lib/shopify_api/rest/resources/2023_10/location.rb +167 -0
  85. data/lib/shopify_api/rest/resources/2023_10/locations_for_move.rb +56 -0
  86. data/lib/shopify_api/rest/resources/2023_10/marketing_event.rb +209 -0
  87. data/lib/shopify_api/rest/resources/2023_10/metafield.rb +344 -0
  88. data/lib/shopify_api/rest/resources/2023_10/mobile_platform_application.rb +110 -0
  89. data/lib/shopify_api/rest/resources/2023_10/order.rb +491 -0
  90. data/lib/shopify_api/rest/resources/2023_10/order_risk.rb +144 -0
  91. data/lib/shopify_api/rest/resources/2023_10/page.rb +194 -0
  92. data/lib/shopify_api/rest/resources/2023_10/payment.rb +140 -0
  93. data/lib/shopify_api/rest/resources/2023_10/payment_gateway.rb +143 -0
  94. data/lib/shopify_api/rest/resources/2023_10/payment_transaction.rb +107 -0
  95. data/lib/shopify_api/rest/resources/2023_10/payout.rb +97 -0
  96. data/lib/shopify_api/rest/resources/2023_10/policy.rb +69 -0
  97. data/lib/shopify_api/rest/resources/2023_10/price_rule.rb +223 -0
  98. data/lib/shopify_api/rest/resources/2023_10/product.rb +223 -0
  99. data/lib/shopify_api/rest/resources/2023_10/product_listing.rb +196 -0
  100. data/lib/shopify_api/rest/resources/2023_10/product_resource_feedback.rb +88 -0
  101. data/lib/shopify_api/rest/resources/2023_10/province.rb +132 -0
  102. data/lib/shopify_api/rest/resources/2023_10/recurring_application_charge.rb +172 -0
  103. data/lib/shopify_api/rest/resources/2023_10/redirect.rb +139 -0
  104. data/lib/shopify_api/rest/resources/2023_10/refund.rb +151 -0
  105. data/lib/shopify_api/rest/resources/2023_10/report.rb +121 -0
  106. data/lib/shopify_api/rest/resources/2023_10/resource_feedback.rb +73 -0
  107. data/lib/shopify_api/rest/resources/2023_10/script_tag.rb +155 -0
  108. data/lib/shopify_api/rest/resources/2023_10/shipping_zone.rb +83 -0
  109. data/lib/shopify_api/rest/resources/2023_10/shop.rb +218 -0
  110. data/lib/shopify_api/rest/resources/2023_10/smart_collection.rb +216 -0
  111. data/lib/shopify_api/rest/resources/2023_10/storefront_access_token.rb +87 -0
  112. data/lib/shopify_api/rest/resources/2023_10/tender_transaction.rb +93 -0
  113. data/lib/shopify_api/rest/resources/2023_10/theme.rb +123 -0
  114. data/lib/shopify_api/rest/resources/2023_10/transaction.rb +184 -0
  115. data/lib/shopify_api/rest/resources/2023_10/usage_charge.rb +102 -0
  116. data/lib/shopify_api/rest/resources/2023_10/user.rb +138 -0
  117. data/lib/shopify_api/rest/resources/2023_10/variant.rb +208 -0
  118. data/lib/shopify_api/rest/resources/2023_10/webhook.rb +168 -0
  119. data/lib/shopify_api/version.rb +1 -1
  120. data/lib/shopify_api/webhooks/registration.rb +19 -4
  121. data/lib/shopify_api/webhooks/registrations/event_bridge.rb +1 -1
  122. data/lib/shopify_api/webhooks/registrations/http.rb +1 -1
  123. data/lib/shopify_api/webhooks/registrations/pub_sub.rb +2 -1
  124. data/lib/shopify_api/webhooks/registry.rb +9 -5
  125. metadata +80 -6
  126. data/.github/workflows/stale.yml +0 -43
  127. data/docs/issues.md +0 -39
  128. data/docs/usage/session_storage.md +0 -46
@@ -0,0 +1,137 @@
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 Country < 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
+ @id = T.let(nil, T.nilable(Integer))
21
+ @name = T.let(nil, T.nilable(String))
22
+ @provinces = T.let(nil, T.nilable(T::Array[T.untyped]))
23
+ @tax = T.let(nil, T.nilable(Float))
24
+ end
25
+
26
+ @has_one = T.let({}, T::Hash[Symbol, Class])
27
+ @has_many = T.let({
28
+ provinces: Province
29
+ }, T::Hash[Symbol, Class])
30
+ @paths = T.let([
31
+ {http_method: :delete, operation: :delete, ids: [:id], path: "countries/<id>.json"},
32
+ {http_method: :get, operation: :count, ids: [], path: "countries/count.json"},
33
+ {http_method: :get, operation: :get, ids: [], path: "countries.json"},
34
+ {http_method: :get, operation: :get, ids: [:id], path: "countries/<id>.json"},
35
+ {http_method: :post, operation: :post, ids: [], path: "countries.json"},
36
+ {http_method: :put, operation: :put, ids: [:id], path: "countries/<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 :id
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :name
45
+ sig { returns(T.nilable(T::Array[Province])) }
46
+ attr_reader :provinces
47
+ sig { returns(T.nilable(Float)) }
48
+ attr_reader :tax
49
+
50
+ class << self
51
+ sig do
52
+ params(
53
+ id: T.any(Integer, String),
54
+ fields: T.untyped,
55
+ session: Auth::Session
56
+ ).returns(T.nilable(Country))
57
+ end
58
+ def find(
59
+ id:,
60
+ fields: nil,
61
+ session: ShopifyAPI::Context.active_session
62
+ )
63
+ result = base_find(
64
+ session: session,
65
+ ids: {id: id},
66
+ params: {fields: fields},
67
+ )
68
+ T.cast(result[0], T.nilable(Country))
69
+ end
70
+
71
+ sig do
72
+ params(
73
+ id: T.any(Integer, String),
74
+ session: Auth::Session
75
+ ).returns(T.untyped)
76
+ end
77
+ def delete(
78
+ id:,
79
+ session: ShopifyAPI::Context.active_session
80
+ )
81
+ request(
82
+ http_method: :delete,
83
+ operation: :delete,
84
+ session: session,
85
+ ids: {id: id},
86
+ params: {},
87
+ )
88
+ end
89
+
90
+ sig do
91
+ params(
92
+ since_id: T.untyped,
93
+ fields: T.untyped,
94
+ session: Auth::Session,
95
+ kwargs: T.untyped
96
+ ).returns(T::Array[Country])
97
+ end
98
+ def all(
99
+ since_id: nil,
100
+ fields: nil,
101
+ session: ShopifyAPI::Context.active_session,
102
+ **kwargs
103
+ )
104
+ response = base_find(
105
+ session: session,
106
+ ids: {},
107
+ params: {since_id: since_id, fields: fields}.merge(kwargs).compact,
108
+ )
109
+
110
+ T.cast(response, T::Array[Country])
111
+ end
112
+
113
+ sig do
114
+ params(
115
+ session: Auth::Session,
116
+ kwargs: T.untyped
117
+ ).returns(T.untyped)
118
+ end
119
+ def count(
120
+ session: ShopifyAPI::Context.active_session,
121
+ **kwargs
122
+ )
123
+ request(
124
+ http_method: :get,
125
+ operation: :count,
126
+ session: session,
127
+ ids: {},
128
+ params: {}.merge(kwargs).compact,
129
+ body: {},
130
+ entity: nil,
131
+ )
132
+ end
133
+
134
+ end
135
+
136
+ end
137
+ end
@@ -0,0 +1,57 @@
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 Currency < 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
+ @currency = T.let(nil, T.nilable(String))
20
+ @rate_updated_at = T.let(nil, T.nilable(String))
21
+ end
22
+
23
+ @has_one = T.let({}, T::Hash[Symbol, Class])
24
+ @has_many = T.let({}, T::Hash[Symbol, Class])
25
+ @paths = T.let([
26
+ {http_method: :get, operation: :get, ids: [], path: "currencies.json"}
27
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
28
+
29
+ sig { returns(T.nilable(String)) }
30
+ attr_reader :currency
31
+ sig { returns(T.nilable(String)) }
32
+ attr_reader :rate_updated_at
33
+
34
+ class << self
35
+ sig do
36
+ params(
37
+ session: Auth::Session,
38
+ kwargs: T.untyped
39
+ ).returns(T::Array[Currency])
40
+ end
41
+ def all(
42
+ session: ShopifyAPI::Context.active_session,
43
+ **kwargs
44
+ )
45
+ response = base_find(
46
+ session: session,
47
+ ids: {},
48
+ params: {}.merge(kwargs).compact,
49
+ )
50
+
51
+ T.cast(response, T::Array[Currency])
52
+ end
53
+
54
+ end
55
+
56
+ end
57
+ end
@@ -0,0 +1,187 @@
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 CustomCollection < 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
+ @title = T.let(nil, T.nilable(String))
20
+ @body_html = T.let(nil, T.nilable(String))
21
+ @handle = T.let(nil, T.nilable(String))
22
+ @id = T.let(nil, T.nilable(Integer))
23
+ @image = T.let(nil, T.nilable(T.any(String, T::Hash[T.untyped, T.untyped])))
24
+ @published = T.let(nil, T.nilable(T::Boolean))
25
+ @published_at = T.let(nil, T.nilable(String))
26
+ @published_scope = T.let(nil, T.nilable(String))
27
+ @sort_order = T.let(nil, T.nilable(String))
28
+ @template_suffix = T.let(nil, T.nilable(String))
29
+ @updated_at = T.let(nil, T.nilable(String))
30
+ end
31
+
32
+ @has_one = T.let({}, T::Hash[Symbol, Class])
33
+ @has_many = T.let({}, T::Hash[Symbol, Class])
34
+ @paths = T.let([
35
+ {http_method: :delete, operation: :delete, ids: [:id], path: "custom_collections/<id>.json"},
36
+ {http_method: :get, operation: :count, ids: [], path: "custom_collections/count.json"},
37
+ {http_method: :get, operation: :get, ids: [], path: "custom_collections.json"},
38
+ {http_method: :get, operation: :get, ids: [:id], path: "custom_collections/<id>.json"},
39
+ {http_method: :post, operation: :post, ids: [], path: "custom_collections.json"},
40
+ {http_method: :put, operation: :put, ids: [:id], path: "custom_collections/<id>.json"}
41
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
42
+
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :title
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :body_html
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :handle
49
+ sig { returns(T.nilable(Integer)) }
50
+ attr_reader :id
51
+ sig { returns(T.nilable(T.any(String, T::Hash[T.untyped, T.untyped]))) }
52
+ attr_reader :image
53
+ sig { returns(T.nilable(T::Boolean)) }
54
+ attr_reader :published
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :published_at
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :published_scope
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :sort_order
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :template_suffix
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :updated_at
65
+
66
+ class << self
67
+ sig do
68
+ params(
69
+ id: T.any(Integer, String),
70
+ fields: T.untyped,
71
+ session: Auth::Session
72
+ ).returns(T.nilable(CustomCollection))
73
+ end
74
+ def find(
75
+ id:,
76
+ fields: nil,
77
+ session: ShopifyAPI::Context.active_session
78
+ )
79
+ result = base_find(
80
+ session: session,
81
+ ids: {id: id},
82
+ params: {fields: fields},
83
+ )
84
+ T.cast(result[0], T.nilable(CustomCollection))
85
+ end
86
+
87
+ sig do
88
+ params(
89
+ id: T.any(Integer, String),
90
+ session: Auth::Session
91
+ ).returns(T.untyped)
92
+ end
93
+ def delete(
94
+ id:,
95
+ session: ShopifyAPI::Context.active_session
96
+ )
97
+ request(
98
+ http_method: :delete,
99
+ operation: :delete,
100
+ session: session,
101
+ ids: {id: id},
102
+ params: {},
103
+ )
104
+ end
105
+
106
+ sig do
107
+ params(
108
+ limit: T.untyped,
109
+ ids: T.untyped,
110
+ since_id: T.untyped,
111
+ title: T.untyped,
112
+ product_id: T.untyped,
113
+ handle: T.untyped,
114
+ updated_at_min: T.untyped,
115
+ updated_at_max: T.untyped,
116
+ published_at_min: T.untyped,
117
+ published_at_max: T.untyped,
118
+ published_status: T.untyped,
119
+ fields: T.untyped,
120
+ session: Auth::Session,
121
+ kwargs: T.untyped
122
+ ).returns(T::Array[CustomCollection])
123
+ end
124
+ def all(
125
+ limit: nil,
126
+ ids: nil,
127
+ since_id: nil,
128
+ title: nil,
129
+ product_id: nil,
130
+ handle: nil,
131
+ updated_at_min: nil,
132
+ updated_at_max: nil,
133
+ published_at_min: nil,
134
+ published_at_max: nil,
135
+ published_status: nil,
136
+ fields: nil,
137
+ session: ShopifyAPI::Context.active_session,
138
+ **kwargs
139
+ )
140
+ response = base_find(
141
+ session: session,
142
+ ids: {},
143
+ params: {limit: limit, ids: ids, since_id: since_id, title: title, product_id: product_id, handle: handle, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status, fields: fields}.merge(kwargs).compact,
144
+ )
145
+
146
+ T.cast(response, T::Array[CustomCollection])
147
+ end
148
+
149
+ sig do
150
+ params(
151
+ title: T.untyped,
152
+ product_id: T.untyped,
153
+ updated_at_min: T.untyped,
154
+ updated_at_max: T.untyped,
155
+ published_at_min: T.untyped,
156
+ published_at_max: T.untyped,
157
+ published_status: T.untyped,
158
+ session: Auth::Session,
159
+ kwargs: T.untyped
160
+ ).returns(T.untyped)
161
+ end
162
+ def count(
163
+ title: nil,
164
+ product_id: nil,
165
+ updated_at_min: nil,
166
+ updated_at_max: nil,
167
+ published_at_min: nil,
168
+ published_at_max: nil,
169
+ published_status: nil,
170
+ session: ShopifyAPI::Context.active_session,
171
+ **kwargs
172
+ )
173
+ request(
174
+ http_method: :get,
175
+ operation: :count,
176
+ session: session,
177
+ ids: {},
178
+ params: {title: title, product_id: product_id, updated_at_min: updated_at_min, updated_at_max: updated_at_max, published_at_min: published_at_min, published_at_max: published_at_max, published_status: published_status}.merge(kwargs).compact,
179
+ body: {},
180
+ entity: nil,
181
+ )
182
+ end
183
+
184
+ end
185
+
186
+ end
187
+ end
@@ -0,0 +1,329 @@
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 Customer < 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
+ @accepts_marketing = T.let(nil, T.nilable(T::Boolean))
20
+ @accepts_marketing_updated_at = T.let(nil, T.nilable(String))
21
+ @addresses = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @currency = T.let(nil, T.nilable(String))
24
+ @default_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
25
+ @email = T.let(nil, T.nilable(String))
26
+ @email_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
27
+ @first_name = T.let(nil, T.nilable(String))
28
+ @id = T.let(nil, T.nilable(Integer))
29
+ @last_name = T.let(nil, T.nilable(String))
30
+ @last_order_id = T.let(nil, T.nilable(Integer))
31
+ @last_order_name = T.let(nil, T.nilable(String))
32
+ @marketing_opt_in_level = T.let(nil, T.nilable(String))
33
+ @metafield = T.let(nil, T.nilable(Metafield))
34
+ @multipass_identifier = T.let(nil, T.nilable(String))
35
+ @note = T.let(nil, T.nilable(String))
36
+ @orders_count = T.let(nil, T.nilable(Integer))
37
+ @password = T.let(nil, T.nilable(String))
38
+ @password_confirmation = T.let(nil, T.nilable(String))
39
+ @phone = T.let(nil, T.nilable(String))
40
+ @sms_marketing_consent = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
41
+ @state = T.let(nil, T.nilable(String))
42
+ @tags = T.let(nil, T.nilable(String))
43
+ @tax_exempt = T.let(nil, T.nilable(T::Boolean))
44
+ @tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped]))
45
+ @total_spent = T.let(nil, T.nilable(String))
46
+ @updated_at = T.let(nil, T.nilable(String))
47
+ @verified_email = T.let(nil, T.nilable(T::Boolean))
48
+ end
49
+
50
+ @has_one = T.let({
51
+ metafield: Metafield
52
+ }, T::Hash[Symbol, Class])
53
+ @has_many = T.let({}, T::Hash[Symbol, Class])
54
+ @paths = T.let([
55
+ {http_method: :delete, operation: :delete, ids: [:id], path: "customers/<id>.json"},
56
+ {http_method: :get, operation: :count, ids: [], path: "customers/count.json"},
57
+ {http_method: :get, operation: :get, ids: [], path: "customers.json"},
58
+ {http_method: :get, operation: :get, ids: [:id], path: "customers/<id>.json"},
59
+ {http_method: :get, operation: :orders, ids: [:id], path: "customers/<id>/orders.json"},
60
+ {http_method: :get, operation: :search, ids: [], path: "customers/search.json"},
61
+ {http_method: :post, operation: :account_activation_url, ids: [:id], path: "customers/<id>/account_activation_url.json"},
62
+ {http_method: :post, operation: :post, ids: [], path: "customers.json"},
63
+ {http_method: :post, operation: :send_invite, ids: [:id], path: "customers/<id>/send_invite.json"},
64
+ {http_method: :put, operation: :put, ids: [:id], path: "customers/<id>.json"}
65
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
66
+
67
+ sig { returns(T.nilable(T::Boolean)) }
68
+ attr_reader :accepts_marketing
69
+ sig { returns(T.nilable(String)) }
70
+ attr_reader :accepts_marketing_updated_at
71
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
72
+ attr_reader :addresses
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :created_at
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :currency
77
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
78
+ attr_reader :default_address
79
+ sig { returns(T.nilable(String)) }
80
+ attr_reader :email
81
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
82
+ attr_reader :email_marketing_consent
83
+ sig { returns(T.nilable(String)) }
84
+ attr_reader :first_name
85
+ sig { returns(T.nilable(Integer)) }
86
+ attr_reader :id
87
+ sig { returns(T.nilable(String)) }
88
+ attr_reader :last_name
89
+ sig { returns(T.nilable(Integer)) }
90
+ attr_reader :last_order_id
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :last_order_name
93
+ sig { returns(T.nilable(String)) }
94
+ attr_reader :marketing_opt_in_level
95
+ sig { returns(T.nilable(Metafield)) }
96
+ attr_reader :metafield
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :multipass_identifier
99
+ sig { returns(T.nilable(String)) }
100
+ attr_reader :note
101
+ sig { returns(T.nilable(Integer)) }
102
+ attr_reader :orders_count
103
+ sig { returns(T.nilable(String)) }
104
+ attr_reader :password
105
+ sig { returns(T.nilable(String)) }
106
+ attr_reader :password_confirmation
107
+ sig { returns(T.nilable(String)) }
108
+ attr_reader :phone
109
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
110
+ attr_reader :sms_marketing_consent
111
+ sig { returns(T.nilable(String)) }
112
+ attr_reader :state
113
+ sig { returns(T.nilable(String)) }
114
+ attr_reader :tags
115
+ sig { returns(T.nilable(T::Boolean)) }
116
+ attr_reader :tax_exempt
117
+ sig { returns(T.nilable(T::Array[String])) }
118
+ attr_reader :tax_exemptions
119
+ sig { returns(T.nilable(String)) }
120
+ attr_reader :total_spent
121
+ sig { returns(T.nilable(String)) }
122
+ attr_reader :updated_at
123
+ sig { returns(T.nilable(T::Boolean)) }
124
+ attr_reader :verified_email
125
+
126
+ class << self
127
+ sig do
128
+ params(
129
+ id: T.any(Integer, String),
130
+ fields: T.untyped,
131
+ session: Auth::Session
132
+ ).returns(T.nilable(Customer))
133
+ end
134
+ def find(
135
+ id:,
136
+ fields: nil,
137
+ session: ShopifyAPI::Context.active_session
138
+ )
139
+ result = base_find(
140
+ session: session,
141
+ ids: {id: id},
142
+ params: {fields: fields},
143
+ )
144
+ T.cast(result[0], T.nilable(Customer))
145
+ end
146
+
147
+ sig do
148
+ params(
149
+ id: T.any(Integer, String),
150
+ session: Auth::Session
151
+ ).returns(T.untyped)
152
+ end
153
+ def delete(
154
+ id:,
155
+ session: ShopifyAPI::Context.active_session
156
+ )
157
+ request(
158
+ http_method: :delete,
159
+ operation: :delete,
160
+ session: session,
161
+ ids: {id: id},
162
+ params: {},
163
+ )
164
+ end
165
+
166
+ sig do
167
+ params(
168
+ ids: T.untyped,
169
+ since_id: T.untyped,
170
+ created_at_min: T.untyped,
171
+ created_at_max: T.untyped,
172
+ updated_at_min: T.untyped,
173
+ updated_at_max: T.untyped,
174
+ limit: T.untyped,
175
+ fields: T.untyped,
176
+ session: Auth::Session,
177
+ kwargs: T.untyped
178
+ ).returns(T::Array[Customer])
179
+ end
180
+ def all(
181
+ ids: nil,
182
+ since_id: nil,
183
+ created_at_min: nil,
184
+ created_at_max: nil,
185
+ updated_at_min: nil,
186
+ updated_at_max: nil,
187
+ limit: nil,
188
+ fields: nil,
189
+ session: ShopifyAPI::Context.active_session,
190
+ **kwargs
191
+ )
192
+ response = base_find(
193
+ session: session,
194
+ ids: {},
195
+ params: {ids: ids, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max, limit: limit, fields: fields}.merge(kwargs).compact,
196
+ )
197
+
198
+ T.cast(response, T::Array[Customer])
199
+ end
200
+
201
+ sig do
202
+ params(
203
+ created_at_min: T.untyped,
204
+ created_at_max: T.untyped,
205
+ updated_at_min: T.untyped,
206
+ updated_at_max: T.untyped,
207
+ session: Auth::Session,
208
+ kwargs: T.untyped
209
+ ).returns(T.untyped)
210
+ end
211
+ def count(
212
+ created_at_min: nil,
213
+ created_at_max: nil,
214
+ updated_at_min: nil,
215
+ updated_at_max: nil,
216
+ session: ShopifyAPI::Context.active_session,
217
+ **kwargs
218
+ )
219
+ request(
220
+ http_method: :get,
221
+ operation: :count,
222
+ session: session,
223
+ ids: {},
224
+ params: {created_at_min: created_at_min, created_at_max: created_at_max, updated_at_min: updated_at_min, updated_at_max: updated_at_max}.merge(kwargs).compact,
225
+ body: {},
226
+ entity: nil,
227
+ )
228
+ end
229
+
230
+ sig do
231
+ params(
232
+ id: T.any(Integer, String),
233
+ status: T.untyped,
234
+ session: Auth::Session,
235
+ kwargs: T.untyped
236
+ ).returns(T.untyped)
237
+ end
238
+ def orders(
239
+ id:,
240
+ status: nil,
241
+ session: ShopifyAPI::Context.active_session,
242
+ **kwargs
243
+ )
244
+ request(
245
+ http_method: :get,
246
+ operation: :orders,
247
+ session: session,
248
+ ids: {id: id},
249
+ params: {status: status}.merge(kwargs).compact,
250
+ body: {},
251
+ entity: nil,
252
+ )
253
+ end
254
+
255
+ sig do
256
+ params(
257
+ order: T.untyped,
258
+ query: T.untyped,
259
+ limit: T.untyped,
260
+ fields: T.untyped,
261
+ session: Auth::Session,
262
+ kwargs: T.untyped
263
+ ).returns(T.untyped)
264
+ end
265
+ def search(
266
+ order: nil,
267
+ query: nil,
268
+ limit: nil,
269
+ fields: nil,
270
+ session: ShopifyAPI::Context.active_session,
271
+ **kwargs
272
+ )
273
+ request(
274
+ http_method: :get,
275
+ operation: :search,
276
+ session: session,
277
+ ids: {},
278
+ params: {order: order, query: query, limit: limit, fields: fields}.merge(kwargs).compact,
279
+ body: {},
280
+ entity: nil,
281
+ )
282
+ end
283
+
284
+ end
285
+
286
+ sig do
287
+ params(
288
+ body: T.untyped,
289
+ kwargs: T.untyped
290
+ ).returns(T.untyped)
291
+ end
292
+ def account_activation_url(
293
+ body: nil,
294
+ **kwargs
295
+ )
296
+ self.class.request(
297
+ http_method: :post,
298
+ operation: :account_activation_url,
299
+ session: @session,
300
+ ids: {id: @id},
301
+ params: {}.merge(kwargs).compact,
302
+ body: body,
303
+ entity: self,
304
+ )
305
+ end
306
+
307
+ sig do
308
+ params(
309
+ body: T.untyped,
310
+ kwargs: T.untyped
311
+ ).returns(T.untyped)
312
+ end
313
+ def send_invite(
314
+ body: nil,
315
+ **kwargs
316
+ )
317
+ self.class.request(
318
+ http_method: :post,
319
+ operation: :send_invite,
320
+ session: @session,
321
+ ids: {id: @id},
322
+ params: {}.merge(kwargs).compact,
323
+ body: body,
324
+ entity: self,
325
+ )
326
+ end
327
+
328
+ end
329
+ end