shopify_api 14.0.0 → 14.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/BUG_REPORT.md +23 -17
  3. data/.github/workflows/build.yml +2 -0
  4. data/.rubocop.yml +0 -1
  5. data/.ruby-version +1 -0
  6. data/CHANGELOG.md +13 -0
  7. data/Gemfile +13 -1
  8. data/Gemfile.lock +24 -22
  9. data/dev.yml +1 -1
  10. data/docs/usage/custom_apps.md +3 -3
  11. data/docs/usage/graphql_storefront.md +13 -6
  12. data/docs/usage/rest.md +1 -1
  13. data/docs/usage/webhooks.md +2 -2
  14. data/lib/shopify_api/admin_versions.rb +2 -1
  15. data/lib/shopify_api/auth/session.rb +3 -3
  16. data/lib/shopify_api/clients/graphql/storefront.rb +26 -4
  17. data/lib/shopify_api/logger.rb +1 -1
  18. data/lib/shopify_api/rest/resources/2022_04/fulfillment_event.rb +5 -8
  19. data/lib/shopify_api/rest/resources/2022_04/inventory_item.rb +2 -2
  20. data/lib/shopify_api/rest/resources/2022_04/variant.rb +6 -6
  21. data/lib/shopify_api/rest/resources/2022_07/fulfillment_event.rb +5 -8
  22. data/lib/shopify_api/rest/resources/2022_07/inventory_item.rb +2 -2
  23. data/lib/shopify_api/rest/resources/2022_07/variant.rb +6 -6
  24. data/lib/shopify_api/rest/resources/2022_10/fulfillment_event.rb +5 -8
  25. data/lib/shopify_api/rest/resources/2022_10/inventory_item.rb +2 -2
  26. data/lib/shopify_api/rest/resources/2022_10/variant.rb +4 -4
  27. data/lib/shopify_api/rest/resources/2023_01/fulfillment_event.rb +5 -8
  28. data/lib/shopify_api/rest/resources/2023_01/inventory_item.rb +2 -2
  29. data/lib/shopify_api/rest/resources/2023_01/variant.rb +4 -4
  30. data/lib/shopify_api/rest/resources/2023_04/fulfillment_event.rb +5 -8
  31. data/lib/shopify_api/rest/resources/2023_04/inventory_item.rb +2 -2
  32. data/lib/shopify_api/rest/resources/2023_04/variant.rb +4 -4
  33. data/lib/shopify_api/rest/resources/2023_07/fulfillment_event.rb +5 -8
  34. data/lib/shopify_api/rest/resources/2023_07/inventory_item.rb +2 -2
  35. data/lib/shopify_api/rest/resources/2023_07/variant.rb +4 -4
  36. data/lib/shopify_api/rest/resources/2023_10/fulfillment_event.rb +5 -8
  37. data/lib/shopify_api/rest/resources/2023_10/inventory_item.rb +2 -2
  38. data/lib/shopify_api/rest/resources/2023_10/variant.rb +4 -4
  39. data/lib/shopify_api/rest/resources/2024_01/fulfillment_event.rb +5 -8
  40. data/lib/shopify_api/rest/resources/2024_01/inventory_item.rb +2 -2
  41. data/lib/shopify_api/rest/resources/2024_01/variant.rb +4 -4
  42. data/lib/shopify_api/rest/resources/2024_04/abandoned_checkout.rb +194 -0
  43. data/lib/shopify_api/rest/resources/2024_04/access_scope.rb +62 -0
  44. data/lib/shopify_api/rest/resources/2024_04/apple_pay_certificate.rb +109 -0
  45. data/lib/shopify_api/rest/resources/2024_04/application_charge.rb +113 -0
  46. data/lib/shopify_api/rest/resources/2024_04/application_credit.rb +95 -0
  47. data/lib/shopify_api/rest/resources/2024_04/article.rb +269 -0
  48. data/lib/shopify_api/rest/resources/2024_04/asset.rb +122 -0
  49. data/lib/shopify_api/rest/resources/2024_04/assigned_fulfillment_order.rb +92 -0
  50. data/lib/shopify_api/rest/resources/2024_04/balance.rb +58 -0
  51. data/lib/shopify_api/rest/resources/2024_04/blog.rb +166 -0
  52. data/lib/shopify_api/rest/resources/2024_04/cancellation_request.rb +87 -0
  53. data/lib/shopify_api/rest/resources/2024_04/carrier_service.rb +120 -0
  54. data/lib/shopify_api/rest/resources/2024_04/checkout.rb +213 -0
  55. data/lib/shopify_api/rest/resources/2024_04/collect.rb +146 -0
  56. data/lib/shopify_api/rest/resources/2024_04/collection.rb +114 -0
  57. data/lib/shopify_api/rest/resources/2024_04/collection_listing.rb +159 -0
  58. data/lib/shopify_api/rest/resources/2024_04/comment.rb +287 -0
  59. data/lib/shopify_api/rest/resources/2024_04/country.rb +141 -0
  60. data/lib/shopify_api/rest/resources/2024_04/currency.rb +61 -0
  61. data/lib/shopify_api/rest/resources/2024_04/custom_collection.rb +191 -0
  62. data/lib/shopify_api/rest/resources/2024_04/customer.rb +333 -0
  63. data/lib/shopify_api/rest/resources/2024_04/customer_address.rb +215 -0
  64. data/lib/shopify_api/rest/resources/2024_04/deprecated_api_call.rb +61 -0
  65. data/lib/shopify_api/rest/resources/2024_04/discount_code.rb +226 -0
  66. data/lib/shopify_api/rest/resources/2024_04/dispute.rb +115 -0
  67. data/lib/shopify_api/rest/resources/2024_04/dispute_evidence.rb +121 -0
  68. data/lib/shopify_api/rest/resources/2024_04/dispute_file_upload.rb +85 -0
  69. data/lib/shopify_api/rest/resources/2024_04/draft_order.rb +279 -0
  70. data/lib/shopify_api/rest/resources/2024_04/event.rb +152 -0
  71. data/lib/shopify_api/rest/resources/2024_04/fulfillment.rb +235 -0
  72. data/lib/shopify_api/rest/resources/2024_04/fulfillment_event.rb +167 -0
  73. data/lib/shopify_api/rest/resources/2024_04/fulfillment_order.rb +326 -0
  74. data/lib/shopify_api/rest/resources/2024_04/fulfillment_request.rb +101 -0
  75. data/lib/shopify_api/rest/resources/2024_04/fulfillment_service.rb +134 -0
  76. data/lib/shopify_api/rest/resources/2024_04/gift_card.rb +222 -0
  77. data/lib/shopify_api/rest/resources/2024_04/gift_card_adjustment.rb +122 -0
  78. data/lib/shopify_api/rest/resources/2024_04/image.rb +161 -0
  79. data/lib/shopify_api/rest/resources/2024_04/inventory_item.rb +112 -0
  80. data/lib/shopify_api/rest/resources/2024_04/inventory_level.rb +183 -0
  81. data/lib/shopify_api/rest/resources/2024_04/location.rb +171 -0
  82. data/lib/shopify_api/rest/resources/2024_04/locations_for_move.rb +60 -0
  83. data/lib/shopify_api/rest/resources/2024_04/marketing_event.rb +213 -0
  84. data/lib/shopify_api/rest/resources/2024_04/metafield.rb +348 -0
  85. data/lib/shopify_api/rest/resources/2024_04/mobile_platform_application.rb +114 -0
  86. data/lib/shopify_api/rest/resources/2024_04/order.rb +489 -0
  87. data/lib/shopify_api/rest/resources/2024_04/order_risk.rb +148 -0
  88. data/lib/shopify_api/rest/resources/2024_04/page.rb +198 -0
  89. data/lib/shopify_api/rest/resources/2024_04/payment.rb +144 -0
  90. data/lib/shopify_api/rest/resources/2024_04/payment_gateway.rb +147 -0
  91. data/lib/shopify_api/rest/resources/2024_04/payment_transaction.rb +114 -0
  92. data/lib/shopify_api/rest/resources/2024_04/payout.rb +101 -0
  93. data/lib/shopify_api/rest/resources/2024_04/policy.rb +73 -0
  94. data/lib/shopify_api/rest/resources/2024_04/price_rule.rb +227 -0
  95. data/lib/shopify_api/rest/resources/2024_04/product.rb +227 -0
  96. data/lib/shopify_api/rest/resources/2024_04/product_listing.rb +200 -0
  97. data/lib/shopify_api/rest/resources/2024_04/product_resource_feedback.rb +92 -0
  98. data/lib/shopify_api/rest/resources/2024_04/province.rb +136 -0
  99. data/lib/shopify_api/rest/resources/2024_04/recurring_application_charge.rb +176 -0
  100. data/lib/shopify_api/rest/resources/2024_04/redirect.rb +143 -0
  101. data/lib/shopify_api/rest/resources/2024_04/refund.rb +155 -0
  102. data/lib/shopify_api/rest/resources/2024_04/resource_feedback.rb +77 -0
  103. data/lib/shopify_api/rest/resources/2024_04/script_tag.rb +159 -0
  104. data/lib/shopify_api/rest/resources/2024_04/shipping_zone.rb +87 -0
  105. data/lib/shopify_api/rest/resources/2024_04/shop.rb +222 -0
  106. data/lib/shopify_api/rest/resources/2024_04/smart_collection.rb +220 -0
  107. data/lib/shopify_api/rest/resources/2024_04/storefront_access_token.rb +91 -0
  108. data/lib/shopify_api/rest/resources/2024_04/tender_transaction.rb +97 -0
  109. data/lib/shopify_api/rest/resources/2024_04/theme.rb +127 -0
  110. data/lib/shopify_api/rest/resources/2024_04/transaction.rb +188 -0
  111. data/lib/shopify_api/rest/resources/2024_04/usage_charge.rb +106 -0
  112. data/lib/shopify_api/rest/resources/2024_04/user.rb +142 -0
  113. data/lib/shopify_api/rest/resources/2024_04/variant.rb +212 -0
  114. data/lib/shopify_api/rest/resources/2024_04/webhook.rb +172 -0
  115. data/lib/shopify_api/version.rb +1 -1
  116. data/lib/shopify_api/webhooks/registry.rb +6 -6
  117. data/lib/shopify_api.rb +1 -0
  118. data/shopify_api.gemspec +0 -8
  119. metadata +77 -101
@@ -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 DisputeEvidence < 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
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @access_activity_log = T.let(nil, T.nilable(String))
22
+ @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
23
+ @cancellation_policy_disclosure = T.let(nil, T.nilable(String))
24
+ @cancellation_rebuttal = T.let(nil, T.nilable(String))
25
+ @created_at = T.let(nil, T.nilable(String))
26
+ @customer_email_address = T.let(nil, T.nilable(String))
27
+ @customer_first_name = T.let(nil, T.nilable(String))
28
+ @customer_last_name = T.let(nil, T.nilable(String))
29
+ @dispute_evidence_files = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
30
+ @fulfillments = T.let(nil, T.nilable(T::Array[T.untyped]))
31
+ @id = T.let(nil, T.nilable(Integer))
32
+ @payments_dispute_id = T.let(nil, T.nilable(Integer))
33
+ @product_description = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
34
+ @refund_policy_disclosure = T.let(nil, T.nilable(String))
35
+ @refund_refusal_explanation = T.let(nil, T.nilable(String))
36
+ @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
37
+ @submitted = T.let(nil, T.nilable(T::Boolean))
38
+ @uncategorized_text = T.let(nil, T.nilable(String))
39
+ @updated_on = T.let(nil, T.nilable(String))
40
+
41
+ super(session: session, from_hash: from_hash)
42
+ end
43
+
44
+ @has_one = T.let({}, T::Hash[Symbol, Class])
45
+ @has_many = T.let({
46
+ fulfillments: Fulfillment
47
+ }, T::Hash[Symbol, Class])
48
+ @paths = T.let([
49
+ {http_method: :get, operation: :get, ids: [:dispute_id], path: "shopify_payments/disputes/<dispute_id>/dispute_evidences.json"},
50
+ {http_method: :put, operation: :put, ids: [:dispute_id], path: "shopify_payments/disputes/<dispute_id>/dispute_evidences.json"}
51
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
52
+
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :access_activity_log
55
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
56
+ attr_reader :billing_address
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :cancellation_policy_disclosure
59
+ sig { returns(T.nilable(String)) }
60
+ attr_reader :cancellation_rebuttal
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :created_at
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :customer_email_address
65
+ sig { returns(T.nilable(String)) }
66
+ attr_reader :customer_first_name
67
+ sig { returns(T.nilable(String)) }
68
+ attr_reader :customer_last_name
69
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
70
+ attr_reader :dispute_evidence_files
71
+ sig { returns(T.nilable(T::Array[Fulfillment])) }
72
+ attr_reader :fulfillments
73
+ sig { returns(T.nilable(Integer)) }
74
+ attr_reader :id
75
+ sig { returns(T.nilable(Integer)) }
76
+ attr_reader :payments_dispute_id
77
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
78
+ attr_reader :product_description
79
+ sig { returns(T.nilable(String)) }
80
+ attr_reader :refund_policy_disclosure
81
+ sig { returns(T.nilable(String)) }
82
+ attr_reader :refund_refusal_explanation
83
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
84
+ attr_reader :shipping_address
85
+ sig { returns(T.nilable(T::Boolean)) }
86
+ attr_reader :submitted
87
+ sig { returns(T.nilable(String)) }
88
+ attr_reader :uncategorized_text
89
+ sig { returns(T.nilable(String)) }
90
+ attr_reader :updated_on
91
+
92
+ class << self
93
+ sig do
94
+ returns(String)
95
+ end
96
+ def primary_key()
97
+ "dispute_id"
98
+ end
99
+
100
+ sig do
101
+ params(
102
+ dispute_id: T.any(Integer, String),
103
+ session: Auth::Session
104
+ ).returns(T.nilable(DisputeEvidence))
105
+ end
106
+ def find(
107
+ dispute_id:,
108
+ session: ShopifyAPI::Context.active_session
109
+ )
110
+ result = base_find(
111
+ session: session,
112
+ ids: {dispute_id: dispute_id},
113
+ params: {},
114
+ )
115
+ T.cast(result[0], T.nilable(DisputeEvidence))
116
+ end
117
+
118
+ end
119
+
120
+ end
121
+ end
@@ -0,0 +1,85 @@
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 DisputeFileUpload < 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
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @dispute_evidence_id = T.let(nil, T.nilable(Integer))
22
+ @dispute_evidence_type = T.let(nil, T.nilable(String))
23
+ @file_size = T.let(nil, T.nilable(Integer))
24
+ @file_type = T.let(nil, T.nilable(String))
25
+ @filename = T.let(nil, T.nilable(String))
26
+ @id = T.let(nil, T.nilable(Integer))
27
+ @original_filename = T.let(nil, T.nilable(String))
28
+ @shop_id = T.let(nil, T.nilable(Integer))
29
+ @url = T.let(nil, T.nilable(String))
30
+
31
+ super(session: session, from_hash: from_hash)
32
+ end
33
+
34
+ @has_one = T.let({}, T::Hash[Symbol, Class])
35
+ @has_many = T.let({}, T::Hash[Symbol, Class])
36
+ @paths = T.let([
37
+ {http_method: :delete, operation: :delete, ids: [:dispute_id, :id], path: "shopify_payments/disputes/<dispute_id>/dispute_file_uploads/<id>.json"},
38
+ {http_method: :post, operation: :post, ids: [:dispute_id], path: "shopify_payments/disputes/<dispute_id>/dispute_file_uploads.json"}
39
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
40
+
41
+ sig { returns(T.nilable(Integer)) }
42
+ attr_reader :dispute_evidence_id
43
+ sig { returns(T.nilable(String)) }
44
+ attr_reader :dispute_evidence_type
45
+ sig { returns(T.nilable(Integer)) }
46
+ attr_reader :file_size
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :file_type
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :filename
51
+ sig { returns(T.nilable(Integer)) }
52
+ attr_reader :id
53
+ sig { returns(T.nilable(String)) }
54
+ attr_reader :original_filename
55
+ sig { returns(T.nilable(Integer)) }
56
+ attr_reader :shop_id
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :url
59
+
60
+ class << self
61
+ sig do
62
+ params(
63
+ id: T.any(Integer, String),
64
+ dispute_id: T.nilable(T.any(Integer, String)),
65
+ session: Auth::Session
66
+ ).returns(T.untyped)
67
+ end
68
+ def delete(
69
+ id:,
70
+ dispute_id: nil,
71
+ session: ShopifyAPI::Context.active_session
72
+ )
73
+ request(
74
+ http_method: :delete,
75
+ operation: :delete,
76
+ session: session,
77
+ ids: {id: id, dispute_id: dispute_id},
78
+ params: {},
79
+ )
80
+ end
81
+
82
+ end
83
+
84
+ end
85
+ end
@@ -0,0 +1,279 @@
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 DraftOrder < 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
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
22
+ @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
23
+ @completed_at = T.let(nil, T.nilable(String))
24
+ @created_at = T.let(nil, T.nilable(String))
25
+ @currency = T.let(nil, T.nilable(String))
26
+ @customer = T.let(nil, T.nilable(Customer))
27
+ @email = T.let(nil, T.nilable(String))
28
+ @id = T.let(nil, T.nilable(Integer))
29
+ @invoice_sent_at = T.let(nil, T.nilable(String))
30
+ @invoice_url = T.let(nil, T.nilable(String))
31
+ @line_items = T.let(nil, T.nilable(T::Array[T.untyped]))
32
+ @name = T.let(nil, T.nilable(String))
33
+ @note = T.let(nil, T.nilable(String))
34
+ @note_attributes = T.let(nil, T.nilable(T::Array[T.untyped]))
35
+ @order_id = T.let(nil, T.nilable(Integer))
36
+ @payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped]))
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
+ @source_name = T.let(nil, T.nilable(String))
40
+ @status = T.let(nil, T.nilable(String))
41
+ @subtotal_price = T.let(nil, T.nilable(String))
42
+ @tags = T.let(nil, T.nilable(String))
43
+ @tax_exempt = T.let(nil, T.nilable(T::Boolean))
44
+ @tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped]))
45
+ @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped]))
46
+ @taxes_included = T.let(nil, T.nilable(T::Boolean))
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
+
51
+ super(session: session, from_hash: from_hash)
52
+ end
53
+
54
+ @has_one = T.let({
55
+ customer: Customer
56
+ }, T::Hash[Symbol, Class])
57
+ @has_many = T.let({}, T::Hash[Symbol, Class])
58
+ @paths = T.let([
59
+ {http_method: :delete, operation: :delete, ids: [:id], path: "draft_orders/<id>.json"},
60
+ {http_method: :get, operation: :count, ids: [], path: "draft_orders/count.json"},
61
+ {http_method: :get, operation: :get, ids: [], path: "draft_orders.json"},
62
+ {http_method: :get, operation: :get, ids: [:id], path: "draft_orders/<id>.json"},
63
+ {http_method: :post, operation: :post, ids: [], path: "draft_orders.json"},
64
+ {http_method: :post, operation: :send_invoice, ids: [:id], path: "draft_orders/<id>/send_invoice.json"},
65
+ {http_method: :put, operation: :complete, ids: [:id], path: "draft_orders/<id>/complete.json"},
66
+ {http_method: :put, operation: :put, ids: [:id], path: "draft_orders/<id>.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 :applied_discount
71
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
72
+ attr_reader :billing_address
73
+ sig { returns(T.nilable(String)) }
74
+ attr_reader :completed_at
75
+ sig { returns(T.nilable(String)) }
76
+ attr_reader :created_at
77
+ sig { returns(T.nilable(String)) }
78
+ attr_reader :currency
79
+ sig { returns(T.nilable(Customer)) }
80
+ attr_reader :customer
81
+ sig { returns(T.nilable(String)) }
82
+ attr_reader :email
83
+ sig { returns(T.nilable(Integer)) }
84
+ attr_reader :id
85
+ sig { returns(T.nilable(String)) }
86
+ attr_reader :invoice_sent_at
87
+ sig { returns(T.nilable(String)) }
88
+ attr_reader :invoice_url
89
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
90
+ attr_reader :line_items
91
+ sig { returns(T.nilable(String)) }
92
+ attr_reader :name
93
+ sig { returns(T.nilable(String)) }
94
+ attr_reader :note
95
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
96
+ attr_reader :note_attributes
97
+ sig { returns(T.nilable(Integer)) }
98
+ attr_reader :order_id
99
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
100
+ attr_reader :payment_terms
101
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
102
+ attr_reader :shipping_address
103
+ sig { returns(T.nilable(T::Hash[T.untyped, T.untyped])) }
104
+ attr_reader :shipping_line
105
+ sig { returns(T.nilable(String)) }
106
+ attr_reader :source_name
107
+ sig { returns(T.nilable(String)) }
108
+ attr_reader :status
109
+ sig { returns(T.nilable(String)) }
110
+ attr_reader :subtotal_price
111
+ sig { returns(T.nilable(String)) }
112
+ attr_reader :tags
113
+ sig { returns(T.nilable(T::Boolean)) }
114
+ attr_reader :tax_exempt
115
+ sig { returns(T.nilable(T::Array[String])) }
116
+ attr_reader :tax_exemptions
117
+ sig { returns(T.nilable(T::Array[T::Hash[T.untyped, T.untyped]])) }
118
+ attr_reader :tax_lines
119
+ sig { returns(T.nilable(T::Boolean)) }
120
+ attr_reader :taxes_included
121
+ sig { returns(T.nilable(String)) }
122
+ attr_reader :total_price
123
+ sig { returns(T.nilable(String)) }
124
+ attr_reader :total_tax
125
+ sig { returns(T.nilable(String)) }
126
+ attr_reader :updated_at
127
+
128
+ class << self
129
+ sig do
130
+ params(
131
+ id: T.any(Integer, String),
132
+ fields: T.untyped,
133
+ session: Auth::Session
134
+ ).returns(T.nilable(DraftOrder))
135
+ end
136
+ def find(
137
+ id:,
138
+ fields: nil,
139
+ session: ShopifyAPI::Context.active_session
140
+ )
141
+ result = base_find(
142
+ session: session,
143
+ ids: {id: id},
144
+ params: {fields: fields},
145
+ )
146
+ T.cast(result[0], T.nilable(DraftOrder))
147
+ end
148
+
149
+ sig do
150
+ params(
151
+ id: T.any(Integer, String),
152
+ session: Auth::Session
153
+ ).returns(T.untyped)
154
+ end
155
+ def delete(
156
+ id:,
157
+ session: ShopifyAPI::Context.active_session
158
+ )
159
+ request(
160
+ http_method: :delete,
161
+ operation: :delete,
162
+ session: session,
163
+ ids: {id: id},
164
+ params: {},
165
+ )
166
+ end
167
+
168
+ sig do
169
+ params(
170
+ fields: T.untyped,
171
+ limit: T.untyped,
172
+ since_id: T.untyped,
173
+ updated_at_min: T.untyped,
174
+ updated_at_max: T.untyped,
175
+ ids: T.untyped,
176
+ status: T.untyped,
177
+ session: Auth::Session,
178
+ kwargs: T.untyped
179
+ ).returns(T::Array[DraftOrder])
180
+ end
181
+ def all(
182
+ fields: nil,
183
+ limit: nil,
184
+ since_id: nil,
185
+ updated_at_min: nil,
186
+ updated_at_max: nil,
187
+ ids: nil,
188
+ status: nil,
189
+ session: ShopifyAPI::Context.active_session,
190
+ **kwargs
191
+ )
192
+ response = base_find(
193
+ session: session,
194
+ ids: {},
195
+ params: {fields: fields, limit: limit, since_id: since_id, updated_at_min: updated_at_min, updated_at_max: updated_at_max, ids: ids, status: status}.merge(kwargs).compact,
196
+ )
197
+
198
+ T.cast(response, T::Array[DraftOrder])
199
+ end
200
+
201
+ sig do
202
+ params(
203
+ since_id: T.untyped,
204
+ status: T.untyped,
205
+ updated_at_max: T.untyped,
206
+ updated_at_min: T.untyped,
207
+ session: Auth::Session,
208
+ kwargs: T.untyped
209
+ ).returns(T.untyped)
210
+ end
211
+ def count(
212
+ since_id: nil,
213
+ status: nil,
214
+ updated_at_max: nil,
215
+ updated_at_min: nil,
216
+ session: ShopifyAPI::Context.active_session,
217
+ **kwargs
218
+ )
219
+ request(
220
+ http_method: :get,
221
+ operation: :count,
222
+ session: session,
223
+ ids: {},
224
+ params: {since_id: since_id, status: status, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact,
225
+ body: {},
226
+ entity: nil,
227
+ )
228
+ end
229
+
230
+ end
231
+
232
+ sig do
233
+ params(
234
+ body: T.untyped,
235
+ kwargs: T.untyped
236
+ ).returns(T.untyped)
237
+ end
238
+ def send_invoice(
239
+ body: nil,
240
+ **kwargs
241
+ )
242
+ self.class.request(
243
+ http_method: :post,
244
+ operation: :send_invoice,
245
+ session: @session,
246
+ ids: {id: @id},
247
+ params: {}.merge(kwargs).compact,
248
+ body: body,
249
+ entity: self,
250
+ )
251
+ end
252
+
253
+ sig do
254
+ params(
255
+ payment_gateway_id: T.untyped,
256
+ payment_pending: T.untyped,
257
+ body: T.untyped,
258
+ kwargs: T.untyped
259
+ ).returns(T.untyped)
260
+ end
261
+ def complete(
262
+ payment_gateway_id: nil,
263
+ payment_pending: nil,
264
+ body: nil,
265
+ **kwargs
266
+ )
267
+ self.class.request(
268
+ http_method: :put,
269
+ operation: :complete,
270
+ session: @session,
271
+ ids: {id: @id},
272
+ params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact,
273
+ body: body,
274
+ entity: self,
275
+ )
276
+ end
277
+
278
+ end
279
+ end
@@ -0,0 +1,152 @@
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 Event < 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
+ @api_call_limit = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
16
+ @retry_request_after = T.let(Concurrent::ThreadLocalVar.new { nil }, Concurrent::ThreadLocalVar)
17
+
18
+ sig { params(session: T.nilable(ShopifyAPI::Auth::Session), from_hash: T.nilable(T::Hash[T.untyped, T.untyped])).void }
19
+ def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil)
20
+
21
+ @arguments = T.let(nil, T.nilable(T::Array[T.untyped]))
22
+ @body = T.let(nil, T.nilable(String))
23
+ @created_at = T.let(nil, T.nilable(String))
24
+ @description = T.let(nil, T.nilable(String))
25
+ @id = T.let(nil, T.nilable(Integer))
26
+ @message = T.let(nil, T.nilable(String))
27
+ @path = T.let(nil, T.nilable(String))
28
+ @subject_id = T.let(nil, T.nilable(Integer))
29
+ @subject_type = T.let(nil, T.nilable(String))
30
+ @verb = T.let(nil, T.nilable(String))
31
+
32
+ super(session: session, from_hash: from_hash)
33
+ end
34
+
35
+ @has_one = T.let({}, T::Hash[Symbol, Class])
36
+ @has_many = T.let({}, T::Hash[Symbol, Class])
37
+ @paths = T.let([
38
+ {http_method: :get, operation: :count, ids: [], path: "events/count.json"},
39
+ {http_method: :get, operation: :get, ids: [], path: "events.json"},
40
+ {http_method: :get, operation: :get, ids: [:id], path: "events/<id>.json"},
41
+ {http_method: :get, operation: :get, ids: [:order_id], path: "orders/<order_id>/events.json"},
42
+ {http_method: :get, operation: :get, ids: [:product_id], path: "products/<product_id>/events.json"}
43
+ ], T::Array[T::Hash[String, T.any(T::Array[Symbol], String, Symbol)]])
44
+
45
+ sig { returns(T.nilable(T::Array[String])) }
46
+ attr_reader :arguments
47
+ sig { returns(T.nilable(String)) }
48
+ attr_reader :body
49
+ sig { returns(T.nilable(String)) }
50
+ attr_reader :created_at
51
+ sig { returns(T.nilable(String)) }
52
+ attr_reader :description
53
+ sig { returns(T.nilable(Integer)) }
54
+ attr_reader :id
55
+ sig { returns(T.nilable(String)) }
56
+ attr_reader :message
57
+ sig { returns(T.nilable(String)) }
58
+ attr_reader :path
59
+ sig { returns(T.nilable(Integer)) }
60
+ attr_reader :subject_id
61
+ sig { returns(T.nilable(String)) }
62
+ attr_reader :subject_type
63
+ sig { returns(T.nilable(String)) }
64
+ attr_reader :verb
65
+
66
+ class << self
67
+ sig do
68
+ params(
69
+ id: T.any(Integer, String),
70
+ fields: T.untyped,
71
+ session: Auth::Session
72
+ ).returns(T.nilable(Event))
73
+ end
74
+ def find(
75
+ id:,
76
+ fields: nil,
77
+ session: ShopifyAPI::Context.active_session
78
+ )
79
+ result = base_find(
80
+ session: session,
81
+ ids: {id: id},
82
+ params: {fields: fields},
83
+ )
84
+ T.cast(result[0], T.nilable(Event))
85
+ end
86
+
87
+ sig do
88
+ params(
89
+ order_id: T.nilable(T.any(Integer, String)),
90
+ product_id: T.nilable(T.any(Integer, String)),
91
+ limit: T.untyped,
92
+ since_id: T.untyped,
93
+ created_at_min: T.untyped,
94
+ created_at_max: T.untyped,
95
+ filter: T.untyped,
96
+ verb: T.untyped,
97
+ fields: T.untyped,
98
+ session: Auth::Session,
99
+ kwargs: T.untyped
100
+ ).returns(T::Array[Event])
101
+ end
102
+ def all(
103
+ order_id: nil,
104
+ product_id: nil,
105
+ limit: nil,
106
+ since_id: nil,
107
+ created_at_min: nil,
108
+ created_at_max: nil,
109
+ filter: nil,
110
+ verb: nil,
111
+ fields: nil,
112
+ session: ShopifyAPI::Context.active_session,
113
+ **kwargs
114
+ )
115
+ response = base_find(
116
+ session: session,
117
+ ids: {order_id: order_id, product_id: product_id},
118
+ params: {limit: limit, since_id: since_id, created_at_min: created_at_min, created_at_max: created_at_max, filter: filter, verb: verb, fields: fields}.merge(kwargs).compact,
119
+ )
120
+
121
+ T.cast(response, T::Array[Event])
122
+ end
123
+
124
+ sig do
125
+ params(
126
+ created_at_min: T.untyped,
127
+ created_at_max: T.untyped,
128
+ session: Auth::Session,
129
+ kwargs: T.untyped
130
+ ).returns(T.untyped)
131
+ end
132
+ def count(
133
+ created_at_min: nil,
134
+ created_at_max: nil,
135
+ session: ShopifyAPI::Context.active_session,
136
+ **kwargs
137
+ )
138
+ request(
139
+ http_method: :get,
140
+ operation: :count,
141
+ session: session,
142
+ ids: {},
143
+ params: {created_at_min: created_at_min, created_at_max: created_at_max}.merge(kwargs).compact,
144
+ body: {},
145
+ entity: nil,
146
+ )
147
+ end
148
+
149
+ end
150
+
151
+ end
152
+ end