shopify_api 13.1.0 → 13.2.0

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