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,86 @@
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 AssignedFulfillmentOrder < 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
+ @assigned_location_id = T.let(nil, T.nilable(Integer))
20
+ @destination = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
21
+ @id = T.let(nil, T.nilable(Integer))
22
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
23
+ @order_id = T.let(nil, T.nilable(Integer))
24
+ @request_status = T.let(nil, T.nilable(String))
25
+ @shop_id = T.let(nil, T.nilable(Integer))
26
+ @status = T.let(nil, T.nilable(String))
27
+ end
28
+
29
+ @has_one = T.let({}, T::Hash[Symbol, Class])
30
+ @has_many = T.let({}, T::Hash[Symbol, Class])
31
+ @paths = T.let([
32
+ {http_method: :get, operation: :get, ids: [], path: "assigned_fulfillment_orders.json"}
33
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
34
+
35
+ sig { returns(T.nilable(Integer)) }
36
+ attr_reader :assigned_location_id
37
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
38
+ attr_reader :destination
39
+ sig { returns(T.nilable(Integer)) }
40
+ attr_reader :id
41
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
42
+ attr_reader :line_items
43
+ sig { returns(T.nilable(Integer)) }
44
+ attr_reader :order_id
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :request_status
47
+ sig { returns(T.nilable(Integer)) }
48
+ attr_reader :shop_id
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :status
51
+
52
+ class << self
53
+ sig do
54
+ returns(String)
55
+ end
56
+ def json_response_body_name()
57
+ "fulfillment_order"
58
+ end
59
+
60
+ sig do
61
+ params(
62
+ assignment_status: T.untyped,
63
+ location_ids: T.nilable(T.any(T::Array[T.untyped], Integer, String)),
64
+ session: Auth::Session,
65
+ kwargs: T.untyped
66
+ ).returns(T::Array[AssignedFulfillmentOrder])
67
+ end
68
+ def all(
69
+ assignment_status: nil,
70
+ location_ids: nil,
71
+ session: ShopifyAPI::Context.active_session,
72
+ **kwargs
73
+ )
74
+ response = base_find(
75
+ session: session,
76
+ ids: {},
77
+ params: {assignment_status: assignment_status, location_ids: location_ids}.merge(kwargs).compact,
78
+ )
79
+
80
+ T.cast(response, T::Array[AssignedFulfillmentOrder])
81
+ end
82
+
83
+ end
84
+
85
+ end
86
+ end
@@ -0,0 +1,50 @@
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 Balance < 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
+ end
20
+
21
+ @has_one = T.let({}, T::Hash[Symbol, Class])
22
+ @has_many = T.let({}, T::Hash[Symbol, Class])
23
+ @paths = T.let([
24
+ {http_method: :get, operation: :get, ids: [], path: "shopify_payments/balance.json"}
25
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
26
+
27
+ class << self
28
+ sig do
29
+ params(
30
+ session: Auth::Session,
31
+ kwargs: T.untyped
32
+ ).returns(T::Array[Balance])
33
+ end
34
+ def all(
35
+ session: ShopifyAPI::Context.active_session,
36
+ **kwargs
37
+ )
38
+ response = base_find(
39
+ session: session,
40
+ ids: {},
41
+ params: {}.merge(kwargs).compact,
42
+ )
43
+
44
+ T.cast(response, T::Array[Balance])
45
+ end
46
+
47
+ end
48
+
49
+ end
50
+ end
@@ -0,0 +1,162 @@
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 Blog < 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
+ @admin_graphql_api_id = T.let(nil, T.nilable(String))
20
+ @commentable = T.let(nil, T.nilable(String))
21
+ @created_at = T.let(nil, T.nilable(String))
22
+ @feedburner = T.let(nil, T.nilable(String))
23
+ @feedburner_location = T.let(nil, T.nilable(String))
24
+ @handle = T.let(nil, T.nilable(String))
25
+ @id = T.let(nil, T.nilable(Integer))
26
+ @metafields = T.let(nil, T.nilable(T::Array[T.untyped]))
27
+ @tags = T.let(nil, T.nilable(String))
28
+ @template_suffix = T.let(nil, T.nilable(String))
29
+ @title = T.let(nil, T.nilable(String))
30
+ @updated_at = T.let(nil, T.nilable(String))
31
+ end
32
+
33
+ @has_one = T.let({}, T::Hash[Symbol, Class])
34
+ @has_many = T.let({
35
+ metafields: Metafield
36
+ }, T::Hash[Symbol, Class])
37
+ @paths = T.let([
38
+ {http_method: :delete, operation: :delete, ids: [:id], path: "blogs/<id>.json"},
39
+ {http_method: :get, operation: :count, ids: [], path: "blogs/count.json"},
40
+ {http_method: :get, operation: :get, ids: [], path: "blogs.json"},
41
+ {http_method: :get, operation: :get, ids: [:id], path: "blogs/<id>.json"},
42
+ {http_method: :post, operation: :post, ids: [], path: "blogs.json"},
43
+ {http_method: :put, operation: :put, ids: [:id], path: "blogs/<id>.json"}
44
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
45
+
46
+ sig { returns(T.nilable(String)) }
47
+ attr_reader :admin_graphql_api_id
48
+ sig { returns(T.nilable(String)) }
49
+ attr_reader :commentable
50
+ sig { returns(T.nilable(String)) }
51
+ attr_reader :created_at
52
+ sig { returns(T.nilable(String)) }
53
+ attr_reader :feedburner
54
+ sig { returns(T.nilable(String)) }
55
+ attr_reader :feedburner_location
56
+ sig { returns(T.nilable(String)) }
57
+ attr_reader :handle
58
+ sig { returns(T.nilable(Integer)) }
59
+ attr_reader :id
60
+ sig { returns(T.nilable(T::Array[Metafield])) }
61
+ attr_reader :metafields
62
+ sig { returns(T.nilable(String)) }
63
+ attr_reader :tags
64
+ sig { returns(T.nilable(String)) }
65
+ attr_reader :template_suffix
66
+ sig { returns(T.nilable(String)) }
67
+ attr_reader :title
68
+ sig { returns(T.nilable(String)) }
69
+ attr_reader :updated_at
70
+
71
+ class << self
72
+ sig do
73
+ params(
74
+ id: T.any(Integer, String),
75
+ fields: T.untyped,
76
+ session: Auth::Session
77
+ ).returns(T.nilable(Blog))
78
+ end
79
+ def find(
80
+ id:,
81
+ fields: nil,
82
+ session: ShopifyAPI::Context.active_session
83
+ )
84
+ result = base_find(
85
+ session: session,
86
+ ids: {id: id},
87
+ params: {fields: fields},
88
+ )
89
+ T.cast(result[0], T.nilable(Blog))
90
+ end
91
+
92
+ sig do
93
+ params(
94
+ id: T.any(Integer, String),
95
+ session: Auth::Session
96
+ ).returns(T.untyped)
97
+ end
98
+ def delete(
99
+ id:,
100
+ session: ShopifyAPI::Context.active_session
101
+ )
102
+ request(
103
+ http_method: :delete,
104
+ operation: :delete,
105
+ session: session,
106
+ ids: {id: id},
107
+ params: {},
108
+ )
109
+ end
110
+
111
+ sig do
112
+ params(
113
+ limit: T.untyped,
114
+ since_id: T.untyped,
115
+ handle: T.untyped,
116
+ fields: T.untyped,
117
+ session: Auth::Session,
118
+ kwargs: T.untyped
119
+ ).returns(T::Array[Blog])
120
+ end
121
+ def all(
122
+ limit: nil,
123
+ since_id: nil,
124
+ handle: nil,
125
+ fields: nil,
126
+ session: ShopifyAPI::Context.active_session,
127
+ **kwargs
128
+ )
129
+ response = base_find(
130
+ session: session,
131
+ ids: {},
132
+ params: {limit: limit, since_id: since_id, handle: handle, fields: fields}.merge(kwargs).compact,
133
+ )
134
+
135
+ T.cast(response, T::Array[Blog])
136
+ end
137
+
138
+ sig do
139
+ params(
140
+ session: Auth::Session,
141
+ kwargs: T.untyped
142
+ ).returns(T.untyped)
143
+ end
144
+ def count(
145
+ session: ShopifyAPI::Context.active_session,
146
+ **kwargs
147
+ )
148
+ request(
149
+ http_method: :get,
150
+ operation: :count,
151
+ session: session,
152
+ ids: {},
153
+ params: {}.merge(kwargs).compact,
154
+ body: {},
155
+ entity: nil,
156
+ )
157
+ end
158
+
159
+ end
160
+
161
+ end
162
+ end
@@ -0,0 +1,83 @@
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 CancellationRequest < 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
+ @fulfillment_order_id = T.let(nil, T.nilable(Integer))
20
+ end
21
+
22
+ @has_one = T.let({}, T::Hash[Symbol, Class])
23
+ @has_many = T.let({}, T::Hash[Symbol, Class])
24
+ @paths = T.let([
25
+ {http_method: :post, operation: :accept, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/cancellation_request/accept.json"},
26
+ {http_method: :post, operation: :post, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/cancellation_request.json"},
27
+ {http_method: :post, operation: :reject, ids: [:fulfillment_order_id], path: "fulfillment_orders/<fulfillment_order_id>/cancellation_request/reject.json"}
28
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
29
+
30
+ sig { returns(T.nilable(Integer)) }
31
+ attr_reader :fulfillment_order_id
32
+
33
+ class << self
34
+ end
35
+
36
+ sig do
37
+ params(
38
+ message: T.untyped,
39
+ body: T.untyped,
40
+ kwargs: T.untyped
41
+ ).returns(T.untyped)
42
+ end
43
+ def accept(
44
+ message: nil,
45
+ body: nil,
46
+ **kwargs
47
+ )
48
+ self.class.request(
49
+ http_method: :post,
50
+ operation: :accept,
51
+ session: @session,
52
+ ids: {fulfillment_order_id: @fulfillment_order_id},
53
+ params: {message: message}.merge(kwargs).compact,
54
+ body: body,
55
+ entity: self,
56
+ )
57
+ end
58
+
59
+ sig do
60
+ params(
61
+ message: T.untyped,
62
+ body: T.untyped,
63
+ kwargs: T.untyped
64
+ ).returns(T.untyped)
65
+ end
66
+ def reject(
67
+ message: nil,
68
+ body: nil,
69
+ **kwargs
70
+ )
71
+ self.class.request(
72
+ http_method: :post,
73
+ operation: :reject,
74
+ session: @session,
75
+ ids: {fulfillment_order_id: @fulfillment_order_id},
76
+ params: {message: message}.merge(kwargs).compact,
77
+ body: body,
78
+ entity: self,
79
+ )
80
+ end
81
+
82
+ end
83
+ end
@@ -0,0 +1,116 @@
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 CarrierService < 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
+ @active = T.let(nil, T.nilable(T::Boolean))
20
+ @admin_graphql_api_id = T.let(nil, T.nilable(String))
21
+ @callback_url = T.let(nil, T.nilable(String))
22
+ @carrier_service_type = T.let(nil, T.nilable(String))
23
+ @format = T.let(nil, T.nilable(String))
24
+ @id = T.let(nil, T.nilable(Integer))
25
+ @name = T.let(nil, T.nilable(String))
26
+ @service_discovery = T.let(nil, T.nilable(T::Boolean))
27
+ end
28
+
29
+ @has_one = T.let({}, T::Hash[Symbol, Class])
30
+ @has_many = T.let({}, T::Hash[Symbol, Class])
31
+ @paths = T.let([
32
+ {http_method: :delete, operation: :delete, ids: [:id], path: "carrier_services/<id>.json"},
33
+ {http_method: :get, operation: :get, ids: [], path: "carrier_services.json"},
34
+ {http_method: :get, operation: :get, ids: [:id], path: "carrier_services/<id>.json"},
35
+ {http_method: :post, operation: :post, ids: [], path: "carrier_services.json"},
36
+ {http_method: :put, operation: :put, ids: [:id], path: "carrier_services/<id>.json"}
37
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
38
+
39
+ sig { returns(T.nilable(T::Boolean)) }
40
+ attr_reader :active
41
+ sig { returns(T.nilable(String)) }
42
+ attr_reader :admin_graphql_api_id
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :callback_url
45
+ sig { returns(T.nilable(String)) }
46
+ attr_reader :carrier_service_type
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :format
49
+ sig { returns(T.nilable(Integer)) }
50
+ attr_reader :id
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :name
53
+ sig { returns(T.nilable(T::Boolean)) }
54
+ attr_reader :service_discovery
55
+
56
+ class << self
57
+ sig do
58
+ params(
59
+ id: T.any(Integer, String),
60
+ session: Auth::Session
61
+ ).returns(T.nilable(CarrierService))
62
+ end
63
+ def find(
64
+ id:,
65
+ session: ShopifyAPI::Context.active_session
66
+ )
67
+ result = base_find(
68
+ session: session,
69
+ ids: {id: id},
70
+ params: {},
71
+ )
72
+ T.cast(result[0], T.nilable(CarrierService))
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
+ session: Auth::Session,
97
+ kwargs: T.untyped
98
+ ).returns(T::Array[CarrierService])
99
+ end
100
+ def all(
101
+ session: ShopifyAPI::Context.active_session,
102
+ **kwargs
103
+ )
104
+ response = base_find(
105
+ session: session,
106
+ ids: {},
107
+ params: {}.merge(kwargs).compact,
108
+ )
109
+
110
+ T.cast(response, T::Array[CarrierService])
111
+ end
112
+
113
+ end
114
+
115
+ end
116
+ end
@@ -0,0 +1,209 @@
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 Checkout < 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
+ @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
20
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
21
+ @applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
22
+ @buyer_accepts_marketing = T.let(nil, T.nilable(T::Boolean))
23
+ @created_at = T.let(nil, T.nilable(String))
24
+ @currency = T.let(nil, T.nilable(String))
25
+ @customer_id = T.let(nil, T.nilable(Integer))
26
+ @discount_code = T.let(nil, T.nilable(DiscountCode))
27
+ @email = T.let(nil, T.nilable(String))
28
+ @gift_cards = T.let(nil, T.nilable(T::Array[T.untyped]))
29
+ @order = T.let(nil, T.nilable(Order))
30
+ @payment_due = T.let(nil, T.nilable(String))
31
+ @payment_url = T.let(nil, T.nilable(String))
32
+ @phone = T.let(nil, T.nilable(String))
33
+ @presentment_currency = T.let(nil, T.nilable(String))
34
+ @requires_shipping = T.let(nil, T.nilable(T::Boolean))
35
+ @reservation_time = T.let(nil, T.nilable(String))
36
+ @reservation_time_left = T.let(nil, T.nilable(Integer))
37
+ @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
38
+ @shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
39
+ @shipping_rate = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
40
+ @source_identifier = T.let(nil, T.nilable(String))
41
+ @source_name = T.let(nil, T.nilable(String))
42
+ @source_url = T.let(nil, T.nilable(String))
43
+ @subtotal_price = T.let(nil, T.nilable(String))
44
+ @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
45
+ @taxes_included = T.let(nil, T.nilable(T::Boolean))
46
+ @token = T.let(nil, T.nilable(String))
47
+ @total_price = T.let(nil, T.nilable(String))
48
+ @total_tax = T.let(nil, T.nilable(String))
49
+ @updated_at = T.let(nil, T.nilable(String))
50
+ @user_id = T.let(nil, T.nilable(Integer))
51
+ @web_url = T.let(nil, T.nilable(String))
52
+ end
53
+
54
+ @has_one = T.let({
55
+ discount_code: DiscountCode,
56
+ order: Order
57
+ }, T::Hash[Symbol, Class])
58
+ @has_many = T.let({
59
+ gift_cards: GiftCard
60
+ }, T::Hash[Symbol, Class])
61
+ @paths = T.let([
62
+ {http_method: :get, operation: :get, ids: [:token], path: "checkouts/<token>.json"},
63
+ {http_method: :get, operation: :shipping_rates, ids: [:token], path: "checkouts/<token>/shipping_rates.json"},
64
+ {http_method: :post, operation: :complete, ids: [:token], path: "checkouts/<token>/complete.json"},
65
+ {http_method: :post, operation: :post, ids: [], path: "checkouts.json"},
66
+ {http_method: :put, operation: :put, ids: [:token], path: "checkouts/<token>.json"}
67
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
68
+
69
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
70
+ attr_reader :billing_address
71
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
72
+ attr_reader :line_items
73
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
74
+ attr_reader :applied_discount
75
+ sig { returns(T.nilable(T::Boolean)) }
76
+ attr_reader :buyer_accepts_marketing
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :created_at
79
+ sig { returns(T.nilable(String)) }
80
+ attr_reader :currency
81
+ sig { returns(T.nilable(Integer)) }
82
+ attr_reader :customer_id
83
+ sig { returns(T.nilable(DiscountCode)) }
84
+ attr_reader :discount_code
85
+ sig { returns(T.nilable(String)) }
86
+ attr_reader :email
87
+ sig { returns(T.nilable(T::Array[GiftCard])) }
88
+ attr_reader :gift_cards
89
+ sig { returns(T.nilable(Order)) }
90
+ attr_reader :order
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :payment_due
93
+ sig { returns(T.nilable(String)) }
94
+ attr_reader :payment_url
95
+ sig { returns(T.nilable(String)) }
96
+ attr_reader :phone
97
+ sig { returns(T.nilable(String)) }
98
+ attr_reader :presentment_currency
99
+ sig { returns(T.nilable(T::Boolean)) }
100
+ attr_reader :requires_shipping
101
+ sig { returns(T.nilable(String)) }
102
+ attr_reader :reservation_time
103
+ sig { returns(T.nilable(Integer)) }
104
+ attr_reader :reservation_time_left
105
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
106
+ attr_reader :shipping_address
107
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
108
+ attr_reader :shipping_line
109
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
110
+ attr_reader :shipping_rate
111
+ sig { returns(T.nilable(String)) }
112
+ attr_reader :source_identifier
113
+ sig { returns(T.nilable(String)) }
114
+ attr_reader :source_name
115
+ sig { returns(T.nilable(String)) }
116
+ attr_reader :source_url
117
+ sig { returns(T.nilable(String)) }
118
+ attr_reader :subtotal_price
119
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
120
+ attr_reader :tax_lines
121
+ sig { returns(T.nilable(T::Boolean)) }
122
+ attr_reader :taxes_included
123
+ sig { returns(T.nilable(String)) }
124
+ attr_reader :token
125
+ sig { returns(T.nilable(String)) }
126
+ attr_reader :total_price
127
+ sig { returns(T.nilable(String)) }
128
+ attr_reader :total_tax
129
+ sig { returns(T.nilable(String)) }
130
+ attr_reader :updated_at
131
+ sig { returns(T.nilable(Integer)) }
132
+ attr_reader :user_id
133
+ sig { returns(T.nilable(String)) }
134
+ attr_reader :web_url
135
+
136
+ class << self
137
+ sig do
138
+ returns(String)
139
+ end
140
+ def primary_key()
141
+ "token"
142
+ end
143
+
144
+ sig do
145
+ params(
146
+ token: T.any(Integer, String),
147
+ session: Auth::Session
148
+ ).returns(T.nilable(Checkout))
149
+ end
150
+ def find(
151
+ token:,
152
+ session: ShopifyAPI::Context.active_session
153
+ )
154
+ result = base_find(
155
+ session: session,
156
+ ids: {token: token},
157
+ params: {},
158
+ )
159
+ T.cast(result[0], T.nilable(Checkout))
160
+ end
161
+
162
+ sig do
163
+ params(
164
+ token: T.any(Integer, String),
165
+ session: Auth::Session,
166
+ kwargs: T.untyped
167
+ ).returns(T.untyped)
168
+ end
169
+ def shipping_rates(
170
+ token:,
171
+ session: ShopifyAPI::Context.active_session,
172
+ **kwargs
173
+ )
174
+ request(
175
+ http_method: :get,
176
+ operation: :shipping_rates,
177
+ session: session,
178
+ ids: {token: token},
179
+ params: {}.merge(kwargs).compact,
180
+ body: {},
181
+ entity: nil,
182
+ )
183
+ end
184
+
185
+ end
186
+
187
+ sig do
188
+ params(
189
+ body: T.untyped,
190
+ kwargs: T.untyped
191
+ ).returns(T.untyped)
192
+ end
193
+ def complete(
194
+ body: nil,
195
+ **kwargs
196
+ )
197
+ self.class.request(
198
+ http_method: :post,
199
+ operation: :complete,
200
+ session: @session,
201
+ ids: {token: @token},
202
+ params: {}.merge(kwargs).compact,
203
+ body: body,
204
+ entity: self,
205
+ )
206
+ end
207
+
208
+ end
209
+ end