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,139 @@
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 Redirect < 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
+ @id = T.let(nil, T.nilable(Integer))
20
+ @path = T.let(nil, T.nilable(String))
21
+ @target = T.let(nil, T.nilable(String))
22
+ end
23
+
24
+ @has_one = T.let({}, T::Hash[Symbol, Class])
25
+ @has_many = T.let({}, T::Hash[Symbol, Class])
26
+ @paths = T.let([
27
+ {http_method: :delete, operation: :delete, ids: [:id], path: "redirects/<id>.json"},
28
+ {http_method: :get, operation: :count, ids: [], path: "redirects/count.json"},
29
+ {http_method: :get, operation: :get, ids: [], path: "redirects.json"},
30
+ {http_method: :get, operation: :get, ids: [:id], path: "redirects/<id>.json"},
31
+ {http_method: :post, operation: :post, ids: [], path: "redirects.json"},
32
+ {http_method: :put, operation: :put, ids: [:id], path: "redirects/<id>.json"}
33
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
34
+
35
+ sig { returns(T.nilable(Integer)) }
36
+ attr_reader :id
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :path
39
+ sig { returns(T.nilable(String)) }
40
+ attr_reader :target
41
+
42
+ class << self
43
+ sig do
44
+ params(
45
+ id: T.any(Integer, String),
46
+ fields: T.untyped,
47
+ session: Auth::Session
48
+ ).returns(T.nilable(Redirect))
49
+ end
50
+ def find(
51
+ id:,
52
+ fields: nil,
53
+ session: ShopifyAPI::Context.active_session
54
+ )
55
+ result = base_find(
56
+ session: session,
57
+ ids: {id: id},
58
+ params: {fields: fields},
59
+ )
60
+ T.cast(result[0], T.nilable(Redirect))
61
+ end
62
+
63
+ sig do
64
+ params(
65
+ id: T.any(Integer, String),
66
+ session: Auth::Session
67
+ ).returns(T.untyped)
68
+ end
69
+ def delete(
70
+ id:,
71
+ session: ShopifyAPI::Context.active_session
72
+ )
73
+ request(
74
+ http_method: :delete,
75
+ operation: :delete,
76
+ session: session,
77
+ ids: {id: id},
78
+ params: {},
79
+ )
80
+ end
81
+
82
+ sig do
83
+ params(
84
+ limit: T.untyped,
85
+ since_id: T.untyped,
86
+ path: T.untyped,
87
+ target: T.untyped,
88
+ fields: T.untyped,
89
+ session: Auth::Session,
90
+ kwargs: T.untyped
91
+ ).returns(T::Array[Redirect])
92
+ end
93
+ def all(
94
+ limit: nil,
95
+ since_id: nil,
96
+ path: nil,
97
+ target: nil,
98
+ fields: nil,
99
+ session: ShopifyAPI::Context.active_session,
100
+ **kwargs
101
+ )
102
+ response = base_find(
103
+ session: session,
104
+ ids: {},
105
+ params: {limit: limit, since_id: since_id, path: path, target: target, fields: fields}.merge(kwargs).compact,
106
+ )
107
+
108
+ T.cast(response, T::Array[Redirect])
109
+ end
110
+
111
+ sig do
112
+ params(
113
+ path: T.untyped,
114
+ target: T.untyped,
115
+ session: Auth::Session,
116
+ kwargs: T.untyped
117
+ ).returns(T.untyped)
118
+ end
119
+ def count(
120
+ path: nil,
121
+ target: nil,
122
+ session: ShopifyAPI::Context.active_session,
123
+ **kwargs
124
+ )
125
+ request(
126
+ http_method: :get,
127
+ operation: :count,
128
+ session: session,
129
+ ids: {},
130
+ params: {path: path, target: target}.merge(kwargs).compact,
131
+ body: {},
132
+ entity: nil,
133
+ )
134
+ end
135
+
136
+ end
137
+
138
+ end
139
+ end
@@ -0,0 +1,151 @@
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 Refund < 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
+ @duties = T.let(nil, T.nilable(T::Array[T.untyped]))
21
+ @id = T.let(nil, T.nilable(Integer))
22
+ @note = T.let(nil, T.nilable(String))
23
+ @order_adjustments = T.let(nil, T.nilable(T::Array[T.untyped]))
24
+ @order_id = T.let(nil, T.nilable(Integer))
25
+ @processed_at = T.let(nil, T.nilable(String))
26
+ @refund_duties = T.let(nil, T.nilable(T::Array[T.untyped]))
27
+ @refund_line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
28
+ @restock = T.let(nil, T.nilable(T::Boolean))
29
+ @transactions = T.let(nil, T.nilable(T::Array[T.untyped]))
30
+ @user_id = T.let(nil, T.nilable(Integer))
31
+ end
32
+
33
+ @has_one = T.let({}, T::Hash[Symbol, Class])
34
+ @has_many = T.let({
35
+ transactions: Transaction
36
+ }, T::Hash[Symbol, Class])
37
+ @paths = T.let([
38
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/refunds.json"},
39
+ {http_method: :get, operation: :get, ids: [:order_id, :id], path: "orders/<order_id>/refunds/<id>.json"},
40
+ {http_method: :post, operation: :calculate, ids: [:order_id], path: "orders/<order_id>/refunds/calculate.json"},
41
+ {http_method: :post, operation: :post, ids: [:order_id], path: "orders/<order_id>/refunds.json"}
42
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
43
+
44
+ sig { returns(T.nilable(String)) }
45
+ attr_reader :created_at
46
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
47
+ attr_reader :duties
48
+ sig { returns(T.nilable(Integer)) }
49
+ attr_reader :id
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :note
52
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
53
+ attr_reader :order_adjustments
54
+ sig { returns(T.nilable(Integer)) }
55
+ attr_reader :order_id
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :processed_at
58
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
59
+ attr_reader :refund_duties
60
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
61
+ attr_reader :refund_line_items
62
+ sig { returns(T.nilable(T::Boolean)) }
63
+ attr_reader :restock
64
+ sig { returns(T.nilable(T::Array[Transaction])) }
65
+ attr_reader :transactions
66
+ sig { returns(T.nilable(Integer)) }
67
+ attr_reader :user_id
68
+
69
+ class << self
70
+ sig do
71
+ params(
72
+ id: T.any(Integer, String),
73
+ order_id: T.nilable(T.any(Integer, String)),
74
+ fields: T.untyped,
75
+ in_shop_currency: T.untyped,
76
+ session: Auth::Session
77
+ ).returns(T.nilable(Refund))
78
+ end
79
+ def find(
80
+ id:,
81
+ order_id: nil,
82
+ fields: nil,
83
+ in_shop_currency: nil,
84
+ session: ShopifyAPI::Context.active_session
85
+ )
86
+ result = base_find(
87
+ session: session,
88
+ ids: {id: id, order_id: order_id},
89
+ params: {fields: fields, in_shop_currency: in_shop_currency},
90
+ )
91
+ T.cast(result[0], T.nilable(Refund))
92
+ end
93
+
94
+ sig do
95
+ params(
96
+ order_id: T.nilable(T.any(Integer, String)),
97
+ limit: T.untyped,
98
+ fields: T.untyped,
99
+ in_shop_currency: T.untyped,
100
+ session: Auth::Session,
101
+ kwargs: T.untyped
102
+ ).returns(T::Array[Refund])
103
+ end
104
+ def all(
105
+ order_id: nil,
106
+ limit: nil,
107
+ fields: nil,
108
+ in_shop_currency: nil,
109
+ session: ShopifyAPI::Context.active_session,
110
+ **kwargs
111
+ )
112
+ response = base_find(
113
+ session: session,
114
+ ids: {order_id: order_id},
115
+ params: {limit: limit, fields: fields, in_shop_currency: in_shop_currency}.merge(kwargs).compact,
116
+ )
117
+
118
+ T.cast(response, T::Array[Refund])
119
+ end
120
+
121
+ end
122
+
123
+ sig do
124
+ params(
125
+ shipping: T.untyped,
126
+ refund_line_items: T.untyped,
127
+ currency: T.untyped,
128
+ body: T.untyped,
129
+ kwargs: T.untyped
130
+ ).returns(T.untyped)
131
+ end
132
+ def calculate(
133
+ shipping: nil,
134
+ refund_line_items: nil,
135
+ currency: nil,
136
+ body: nil,
137
+ **kwargs
138
+ )
139
+ self.class.request(
140
+ http_method: :post,
141
+ operation: :calculate,
142
+ session: @session,
143
+ ids: {order_id: @order_id},
144
+ params: {shipping: shipping, refund_line_items: refund_line_items, currency: currency}.merge(kwargs).compact,
145
+ body: body,
146
+ entity: self,
147
+ )
148
+ end
149
+
150
+ end
151
+ end
@@ -0,0 +1,121 @@
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 Report < 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
+ @category = T.let(nil, T.nilable(String))
20
+ @id = T.let(nil, T.nilable(Integer))
21
+ @name = T.let(nil, T.nilable(String))
22
+ @shopify_ql = T.let(nil, T.nilable(String))
23
+ @updated_at = T.let(nil, T.nilable(String))
24
+ end
25
+
26
+ @has_one = T.let({}, T::Hash[Symbol, Class])
27
+ @has_many = T.let({}, T::Hash[Symbol, Class])
28
+ @paths = T.let([
29
+ {http_method: :delete, operation: :delete, ids: [:id], path: "reports/<id>.json"},
30
+ {http_method: :get, operation: :get, ids: [], path: "reports.json"},
31
+ {http_method: :get, operation: :get, ids: [:id], path: "reports/<id>.json"},
32
+ {http_method: :post, operation: :post, ids: [], path: "reports.json"},
33
+ {http_method: :put, operation: :put, ids: [:id], path: "reports/<id>.json"}
34
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
35
+
36
+ sig { returns(T.nilable(String)) }
37
+ attr_reader :category
38
+ sig { returns(T.nilable(Integer)) }
39
+ attr_reader :id
40
+ sig { returns(T.nilable(String)) }
41
+ attr_reader :name
42
+ sig { returns(T.nilable(String)) }
43
+ attr_reader :shopify_ql
44
+ sig { returns(T.nilable(String)) }
45
+ attr_reader :updated_at
46
+
47
+ class << self
48
+ sig do
49
+ params(
50
+ id: T.any(Integer, String),
51
+ fields: T.untyped,
52
+ session: Auth::Session
53
+ ).returns(T.nilable(Report))
54
+ end
55
+ def find(
56
+ id:,
57
+ fields: nil,
58
+ session: ShopifyAPI::Context.active_session
59
+ )
60
+ result = base_find(
61
+ session: session,
62
+ ids: {id: id},
63
+ params: {fields: fields},
64
+ )
65
+ T.cast(result[0], T.nilable(Report))
66
+ end
67
+
68
+ sig do
69
+ params(
70
+ id: T.any(Integer, String),
71
+ session: Auth::Session
72
+ ).returns(T.untyped)
73
+ end
74
+ def delete(
75
+ id:,
76
+ session: ShopifyAPI::Context.active_session
77
+ )
78
+ request(
79
+ http_method: :delete,
80
+ operation: :delete,
81
+ session: session,
82
+ ids: {id: id},
83
+ params: {},
84
+ )
85
+ end
86
+
87
+ sig do
88
+ params(
89
+ ids: T.untyped,
90
+ limit: T.untyped,
91
+ since_id: T.untyped,
92
+ updated_at_min: T.untyped,
93
+ updated_at_max: T.untyped,
94
+ fields: T.untyped,
95
+ session: Auth::Session,
96
+ kwargs: T.untyped
97
+ ).returns(T::Array[Report])
98
+ end
99
+ def all(
100
+ ids: nil,
101
+ limit: nil,
102
+ since_id: nil,
103
+ updated_at_min: nil,
104
+ updated_at_max: nil,
105
+ fields: nil,
106
+ session: ShopifyAPI::Context.active_session,
107
+ **kwargs
108
+ )
109
+ response = base_find(
110
+ session: session,
111
+ ids: {},
112
+ params: {ids: ids, limit: limit, since_id: since_id, updated_at_min: updated_at_min, updated_at_max: updated_at_max, fields: fields}.merge(kwargs).compact,
113
+ )
114
+
115
+ T.cast(response, T::Array[Report])
116
+ end
117
+
118
+ end
119
+
120
+ end
121
+ end
@@ -0,0 +1,73 @@
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 ResourceFeedback < 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
+ @resource_id = T.let(nil, T.nilable(Integer))
23
+ @resource_type = T.let(nil, T.nilable(String))
24
+ @state = T.let(nil, T.nilable(String))
25
+ @updated_at = T.let(nil, T.nilable(String))
26
+ end
27
+
28
+ @has_one = T.let({}, T::Hash[Symbol, Class])
29
+ @has_many = T.let({}, T::Hash[Symbol, Class])
30
+ @paths = T.let([
31
+ {http_method: :get, operation: :get, ids: [], path: "resource_feedback.json"},
32
+ {http_method: :post, operation: :post, ids: [], path: "resource_feedback.json"}
33
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
34
+
35
+ sig { returns(T.nilable(String)) }
36
+ attr_reader :created_at
37
+ sig { returns(T.nilable(String)) }
38
+ attr_reader :feedback_generated_at
39
+ sig { returns(T.nilable(T::Array[String])) }
40
+ attr_reader :messages
41
+ sig { returns(T.nilable(Integer)) }
42
+ attr_reader :resource_id
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :resource_type
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :state
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :updated_at
49
+
50
+ class << self
51
+ sig do
52
+ params(
53
+ session: Auth::Session,
54
+ kwargs: T.untyped
55
+ ).returns(T::Array[ResourceFeedback])
56
+ end
57
+ def all(
58
+ session: ShopifyAPI::Context.active_session,
59
+ **kwargs
60
+ )
61
+ response = base_find(
62
+ session: session,
63
+ ids: {},
64
+ params: {}.merge(kwargs).compact,
65
+ )
66
+
67
+ T.cast(response, T::Array[ResourceFeedback])
68
+ end
69
+
70
+ end
71
+
72
+ end
73
+ end
@@ -0,0 +1,155 @@
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 ScriptTag < 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
+ @event = T.let(nil, T.nilable(String))
20
+ @src = T.let(nil, T.nilable(String))
21
+ @cache = T.let(nil, T.nilable(T::Boolean))
22
+ @created_at = T.let(nil, T.nilable(String))
23
+ @display_scope = T.let(nil, T.nilable(String))
24
+ @id = T.let(nil, T.nilable(Integer))
25
+ @updated_at = T.let(nil, T.nilable(String))
26
+ end
27
+
28
+ @has_one = T.let({}, T::Hash[Symbol, Class])
29
+ @has_many = T.let({}, T::Hash[Symbol, Class])
30
+ @paths = T.let([
31
+ {http_method: :delete, operation: :delete, ids: [:id], path: "script_tags/<id>.json"},
32
+ {http_method: :get, operation: :count, ids: [], path: "script_tags/count.json"},
33
+ {http_method: :get, operation: :get, ids: [], path: "script_tags.json"},
34
+ {http_method: :get, operation: :get, ids: [:id], path: "script_tags/<id>.json"},
35
+ {http_method: :post, operation: :post, ids: [], path: "script_tags.json"},
36
+ {http_method: :put, operation: :put, ids: [:id], path: "script_tags/<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 :event
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :src
43
+ sig { returns(T.nilable(T::Boolean)) }
44
+ attr_reader :cache
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :created_at
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :display_scope
49
+ sig { returns(T.nilable(Integer)) }
50
+ attr_reader :id
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :updated_at
53
+
54
+ class << self
55
+ sig do
56
+ params(
57
+ id: T.any(Integer, String),
58
+ fields: T.untyped,
59
+ session: Auth::Session
60
+ ).returns(T.nilable(ScriptTag))
61
+ end
62
+ def find(
63
+ id:,
64
+ fields: nil,
65
+ session: ShopifyAPI::Context.active_session
66
+ )
67
+ result = base_find(
68
+ session: session,
69
+ ids: {id: id},
70
+ params: {fields: fields},
71
+ )
72
+ T.cast(result[0], T.nilable(ScriptTag))
73
+ end
74
+
75
+ sig do
76
+ params(
77
+ id: T.any(Integer, String),
78
+ session: Auth::Session
79
+ ).returns(T.untyped)
80
+ end
81
+ def delete(
82
+ id:,
83
+ session: ShopifyAPI::Context.active_session
84
+ )
85
+ request(
86
+ http_method: :delete,
87
+ operation: :delete,
88
+ session: session,
89
+ ids: {id: id},
90
+ params: {},
91
+ )
92
+ end
93
+
94
+ sig do
95
+ params(
96
+ limit: T.untyped,
97
+ since_id: T.untyped,
98
+ created_at_min: T.untyped,
99
+ created_at_max: T.untyped,
100
+ updated_at_min: T.untyped,
101
+ updated_at_max: T.untyped,
102
+ src: T.untyped,
103
+ fields: T.untyped,
104
+ session: Auth::Session,
105
+ kwargs: T.untyped
106
+ ).returns(T::Array[ScriptTag])
107
+ end
108
+ def all(
109
+ limit: nil,
110
+ since_id: nil,
111
+ created_at_min: nil,
112
+ created_at_max: nil,
113
+ updated_at_min: nil,
114
+ updated_at_max: nil,
115
+ src: nil,
116
+ fields: nil,
117
+ session: ShopifyAPI::Context.active_session,
118
+ **kwargs
119
+ )
120
+ response = base_find(
121
+ session: session,
122
+ ids: {},
123
+ params: {limit: limit, 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, src: src, fields: fields}.merge(kwargs).compact,
124
+ )
125
+
126
+ T.cast(response, T::Array[ScriptTag])
127
+ end
128
+
129
+ sig do
130
+ params(
131
+ src: T.untyped,
132
+ session: Auth::Session,
133
+ kwargs: T.untyped
134
+ ).returns(T.untyped)
135
+ end
136
+ def count(
137
+ src: nil,
138
+ session: ShopifyAPI::Context.active_session,
139
+ **kwargs
140
+ )
141
+ request(
142
+ http_method: :get,
143
+ operation: :count,
144
+ session: session,
145
+ ids: {},
146
+ params: {src: src}.merge(kwargs).compact,
147
+ body: {},
148
+ entity: nil,
149
+ )
150
+ end
151
+
152
+ end
153
+
154
+ end
155
+ end