shopify_api 12.3.0 → 12.4.0

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