Class: ShopifyAPI::DraftOrder
- Inherits:
-
Rest::Base
- Object
- Rest::Base
- ShopifyAPI::DraftOrder
- Extended by:
- T::Sig
- Defined in:
- lib/shopify_api/rest/resources/2022_04/draft_order.rb,
lib/shopify_api/rest/resources/2022_07/draft_order.rb,
lib/shopify_api/rest/resources/2022_10/draft_order.rb,
lib/shopify_api/rest/resources/2023_01/draft_order.rb,
lib/shopify_api/rest/resources/2023_04/draft_order.rb,
lib/shopify_api/rest/resources/2023_07/draft_order.rb,
lib/shopify_api/rest/resources/2023_10/draft_order.rb,
lib/shopify_api/rest/resources/2024_01/draft_order.rb,
lib/shopify_api/rest/resources/2024_04/draft_order.rb,
lib/shopify_api/rest/resources/2024_07/draft_order.rb,
lib/shopify_api/rest/resources/2024_10/draft_order.rb
Instance Attribute Summary collapse
-
#applied_discount ⇒ Object
readonly
Returns the value of attribute applied_discount.
-
#billing_address ⇒ Object
readonly
Returns the value of attribute billing_address.
-
#completed_at ⇒ Object
readonly
Returns the value of attribute completed_at.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#invoice_sent_at ⇒ Object
readonly
Returns the value of attribute invoice_sent_at.
-
#invoice_url ⇒ Object
readonly
Returns the value of attribute invoice_url.
-
#line_items ⇒ Object
readonly
Returns the value of attribute line_items.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#note ⇒ Object
readonly
Returns the value of attribute note.
-
#note_attributes ⇒ Object
readonly
Returns the value of attribute note_attributes.
-
#order_id ⇒ Object
readonly
Returns the value of attribute order_id.
-
#payment_terms ⇒ Object
readonly
Returns the value of attribute payment_terms.
-
#shipping_address ⇒ Object
readonly
Returns the value of attribute shipping_address.
-
#shipping_line ⇒ Object
readonly
Returns the value of attribute shipping_line.
-
#source_name ⇒ Object
readonly
Returns the value of attribute source_name.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subtotal_price ⇒ Object
readonly
Returns the value of attribute subtotal_price.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#tax_exempt ⇒ Object
readonly
Returns the value of attribute tax_exempt.
-
#tax_exemptions ⇒ Object
readonly
Returns the value of attribute tax_exemptions.
-
#tax_lines ⇒ Object
readonly
Returns the value of attribute tax_lines.
-
#taxes_included ⇒ Object
readonly
Returns the value of attribute taxes_included.
-
#total_price ⇒ Object
readonly
Returns the value of attribute total_price.
-
#total_tax ⇒ Object
readonly
Returns the value of attribute total_tax.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Attributes inherited from Rest::Base
Class Method Summary collapse
- .all(fields: nil, limit: nil, since_id: nil, updated_at_min: nil, updated_at_max: nil, ids: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .count(since_id: nil, status: nil, updated_at_max: nil, updated_at_min: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
- .delete(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
- .find(id:, fields: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
Instance Method Summary collapse
- #complete(payment_gateway_id: nil, payment_pending: nil, body: nil, **kwargs) ⇒ Object
-
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ DraftOrder
constructor
A new instance of DraftOrder.
- #send_invoice(body: nil, **kwargs) ⇒ Object
Methods inherited from Rest::Base
api_call_limit, base_find, class_name, create_instance, create_instances_from_response, #delete, get_path, get_path_ids, has_many?, has_one?, inherited, json_body_name, json_response_body_names, #method_missing, next_page?, next_page_info, prev_page?, prev_page_info, primary_key, read_only_attributes, request, #respond_to_missing?, retry_request_after, #save, #save!, #to_hash
Constructor Details
#initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) ⇒ DraftOrder
Returns a new instance of DraftOrder.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 19 def initialize(session: ShopifyAPI::Context.active_session, from_hash: nil) @applied_discount = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped])) @billing_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped])) @completed_at = T.let(nil, T.nilable(String)) @created_at = T.let(nil, T.nilable(String)) @currency = T.let(nil, T.nilable(String)) @customer = T.let(nil, T.nilable(Customer)) @email = T.let(nil, T.nilable(String)) @id = T.let(nil, T.nilable(Integer)) @invoice_sent_at = T.let(nil, T.nilable(String)) @invoice_url = T.let(nil, T.nilable(String)) @line_items = T.let(nil, T.nilable(T::Array[T.untyped])) @name = T.let(nil, T.nilable(String)) @note = T.let(nil, T.nilable(String)) @note_attributes = T.let(nil, T.nilable(T::Array[T.untyped])) @order_id = T.let(nil, T.nilable(Integer)) @payment_terms = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped])) @shipping_address = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped])) @shipping_line = T.let(nil, T.nilable(T::Hash[T.untyped, T.untyped])) @source_name = T.let(nil, T.nilable(String)) @status = T.let(nil, T.nilable(String)) @subtotal_price = T.let(nil, T.nilable(String)) @tags = T.let(nil, T.nilable(String)) @tax_exempt = T.let(nil, T.nilable(T::Boolean)) @tax_exemptions = T.let(nil, T.nilable(T::Array[T.untyped])) @tax_lines = T.let(nil, T.nilable(T::Array[T.untyped])) @taxes_included = T.let(nil, T.nilable(T::Boolean)) @total_price = T.let(nil, T.nilable(String)) @total_tax = T.let(nil, T.nilable(String)) @updated_at = T.let(nil, T.nilable(String)) super(session: session, from_hash: from_hash) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ShopifyAPI::Rest::Base
Instance Attribute Details
#applied_discount ⇒ Object (readonly)
Returns the value of attribute applied_discount.
70 71 72 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 70 def applied_discount @applied_discount end |
#billing_address ⇒ Object (readonly)
Returns the value of attribute billing_address.
72 73 74 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 72 def billing_address @billing_address end |
#completed_at ⇒ Object (readonly)
Returns the value of attribute completed_at.
74 75 76 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 74 def completed_at @completed_at end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
76 77 78 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 76 def created_at @created_at end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
78 79 80 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 78 def currency @currency end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
80 81 82 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 80 def customer @customer end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
82 83 84 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 82 def email @email end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
84 85 86 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 84 def id @id end |
#invoice_sent_at ⇒ Object (readonly)
Returns the value of attribute invoice_sent_at.
86 87 88 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 86 def invoice_sent_at @invoice_sent_at end |
#invoice_url ⇒ Object (readonly)
Returns the value of attribute invoice_url.
88 89 90 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 88 def invoice_url @invoice_url end |
#line_items ⇒ Object (readonly)
Returns the value of attribute line_items.
90 91 92 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 90 def line_items @line_items end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
92 93 94 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 92 def name @name end |
#note ⇒ Object (readonly)
Returns the value of attribute note.
94 95 96 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 94 def note @note end |
#note_attributes ⇒ Object (readonly)
Returns the value of attribute note_attributes.
96 97 98 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 96 def note_attributes @note_attributes end |
#order_id ⇒ Object (readonly)
Returns the value of attribute order_id.
98 99 100 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 98 def order_id @order_id end |
#payment_terms ⇒ Object (readonly)
Returns the value of attribute payment_terms.
100 101 102 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 100 def payment_terms @payment_terms end |
#shipping_address ⇒ Object (readonly)
Returns the value of attribute shipping_address.
102 103 104 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 102 def shipping_address @shipping_address end |
#shipping_line ⇒ Object (readonly)
Returns the value of attribute shipping_line.
104 105 106 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 104 def shipping_line @shipping_line end |
#source_name ⇒ Object (readonly)
Returns the value of attribute source_name.
106 107 108 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 106 def source_name @source_name end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
108 109 110 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 108 def status @status end |
#subtotal_price ⇒ Object (readonly)
Returns the value of attribute subtotal_price.
110 111 112 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 110 def subtotal_price @subtotal_price end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
112 113 114 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 112 def @tags end |
#tax_exempt ⇒ Object (readonly)
Returns the value of attribute tax_exempt.
114 115 116 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 114 def tax_exempt @tax_exempt end |
#tax_exemptions ⇒ Object (readonly)
Returns the value of attribute tax_exemptions.
116 117 118 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 116 def tax_exemptions @tax_exemptions end |
#tax_lines ⇒ Object (readonly)
Returns the value of attribute tax_lines.
118 119 120 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 118 def tax_lines @tax_lines end |
#taxes_included ⇒ Object (readonly)
Returns the value of attribute taxes_included.
120 121 122 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 120 def taxes_included @taxes_included end |
#total_price ⇒ Object (readonly)
Returns the value of attribute total_price.
122 123 124 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 122 def total_price @total_price end |
#total_tax ⇒ Object (readonly)
Returns the value of attribute total_tax.
124 125 126 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 124 def total_tax @total_tax end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
126 127 128 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 126 def updated_at @updated_at end |
Class Method Details
.all(fields: nil, limit: nil, since_id: nil, updated_at_min: nil, updated_at_max: nil, ids: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 181 def all( fields: nil, limit: nil, since_id: nil, updated_at_min: nil, updated_at_max: nil, ids: nil, status: nil, session: ShopifyAPI::Context.active_session, **kwargs ) response = base_find( session: session, ids: {}, 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, ) T.cast(response, T::Array[DraftOrder]) end |
.count(since_id: nil, status: nil, updated_at_max: nil, updated_at_min: nil, session: ShopifyAPI::Context.active_session, **kwargs) ⇒ Object
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 211 def count( since_id: nil, status: nil, updated_at_max: nil, updated_at_min: nil, session: ShopifyAPI::Context.active_session, **kwargs ) request( http_method: :get, operation: :count, session: session, ids: {}, params: {since_id: since_id, status: status, updated_at_max: updated_at_max, updated_at_min: updated_at_min}.merge(kwargs).compact, body: {}, entity: nil, ) end |
.delete(id:, session: ShopifyAPI::Context.active_session) ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 155 def delete( id:, session: ShopifyAPI::Context.active_session ) request( http_method: :delete, operation: :delete, session: session, ids: {id: id}, params: {}, ) end |
.find(id:, fields: nil, session: ShopifyAPI::Context.active_session) ⇒ Object
136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 136 def find( id:, fields: nil, session: ShopifyAPI::Context.active_session ) result = base_find( session: session, ids: {id: id}, params: {fields: fields}, ) T.cast(result[0], T.nilable(DraftOrder)) end |
Instance Method Details
#complete(payment_gateway_id: nil, payment_pending: nil, body: nil, **kwargs) ⇒ Object
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 261 def complete( payment_gateway_id: nil, payment_pending: nil, body: nil, **kwargs ) self.class.request( http_method: :put, operation: :complete, session: @session, ids: {id: @id}, params: {payment_gateway_id: payment_gateway_id, payment_pending: payment_pending}.merge(kwargs).compact, body: body, entity: self, ) end |
#send_invoice(body: nil, **kwargs) ⇒ Object
238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
# File 'lib/shopify_api/rest/resources/2022_04/draft_order.rb', line 238 def send_invoice( body: nil, **kwargs ) self.class.request( http_method: :post, operation: :send_invoice, session: @session, ids: {id: @id}, params: {}.merge(kwargs).compact, body: body, entity: self, ) end |