Class: Pago::V2026_04::Models::CustomerOrderUpdate

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema to update an order.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  billing_name: "billing_name",
  billing_address: "billing_address"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
[].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(billing_name: ::Pago::UNSET, billing_address: ::Pago::UNSET) ⇒ CustomerOrderUpdate

Returns a new instance of CustomerOrderUpdate.

Parameters:

  • billing_name: (String, nil) (defaults to: ::Pago::UNSET)
  • billing_address: (Models::AddressInput, nil) (defaults to: ::Pago::UNSET)


18232
18233
18234
18235
18236
18237
18238
18239
# File 'lib/pago/v2026_04/models.rb', line 18232

def initialize(
  billing_name: ::Pago::UNSET,
  billing_address: ::Pago::UNSET
)
  super()
  assign(:billing_name, billing_name)
  assign(:billing_address, billing_address)
end

Instance Attribute Details

#billing_addressModels::AddressInput? (readonly)

The address of the customer that should appear on the invoice. Country and state fields cannot be updated.

Returns:



18230
18231
18232
# File 'lib/pago/v2026_04/models.rb', line 18230

def billing_address
  @billing_address
end

#billing_nameString? (readonly)

The name of the customer that should appear on the invoice.

Returns:

  • (String, nil)


18226
18227
18228
# File 'lib/pago/v2026_04/models.rb', line 18226

def billing_name
  @billing_name
end

Class Method Details

.from_json(data) ⇒ CustomerOrderUpdate?

Parameters:

  • data (Hash, String, nil)

Returns:



18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
# File 'lib/pago/v2026_04/models.rb', line 18243

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      billing_name: (data.key?("billing_name") ? data["billing_name"] : ::Pago::UNSET),
      billing_address: (data.key?("billing_address") ? Models::AddressInput.from_json(data["billing_address"]) : ::Pago::UNSET)
    ),
    data
  )
end