Class: Pago::V2026_04::Models::CheckoutBillingAddressFields

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

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  country: "country",
  state: "state",
  city: "city",
  postal_code: "postal_code",
  line1: "line1",
  line2: "line2"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["country", "state", "city", "postal_code", "line1", "line2"].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(country:, state:, city:, postal_code:, line1:, line2:) ⇒ CheckoutBillingAddressFields

Returns a new instance of CheckoutBillingAddressFields.

Parameters:

  • country: (String)
  • state: (String)
  • city: (String)
  • postal_code: (String)
  • line1: (String)
  • line2: (String)


9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
# File 'lib/pago/v2026_04/models.rb', line 9595

def initialize(
  country:,
  state:,
  city:,
  postal_code:,
  line1:,
  line2:
)
  super()
  assign(:country, country)
  assign(:state, state)
  assign(:city, city)
  assign(:postal_code, postal_code)
  assign(:line1, line1)
  assign(:line2, line2)
end

Instance Attribute Details

#cityString (readonly)

Returns:

  • (String)


9584
9585
9586
# File 'lib/pago/v2026_04/models.rb', line 9584

def city
  @city
end

#countryString (readonly)

Returns:

  • (String)


9578
9579
9580
# File 'lib/pago/v2026_04/models.rb', line 9578

def country
  @country
end

#line1String (readonly)

Returns:

  • (String)


9590
9591
9592
# File 'lib/pago/v2026_04/models.rb', line 9590

def line1
  @line1
end

#line2String (readonly)

Returns:

  • (String)


9593
9594
9595
# File 'lib/pago/v2026_04/models.rb', line 9593

def line2
  @line2
end

#postal_codeString (readonly)

Returns:

  • (String)


9587
9588
9589
# File 'lib/pago/v2026_04/models.rb', line 9587

def postal_code
  @postal_code
end

#stateString (readonly)

Returns:

  • (String)


9581
9582
9583
# File 'lib/pago/v2026_04/models.rb', line 9581

def state
  @state
end

Class Method Details

.from_json(data) ⇒ CheckoutBillingAddressFields?

Parameters:

  • data (Hash, String, nil)

Returns:



9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
# File 'lib/pago/v2026_04/models.rb', line 9614

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(
      country: (data.key?("country") ? data["country"] : ::Pago::UNSET),
      state: (data.key?("state") ? data["state"] : ::Pago::UNSET),
      city: (data.key?("city") ? data["city"] : ::Pago::UNSET),
      postal_code: (data.key?("postal_code") ? data["postal_code"] : ::Pago::UNSET),
      line1: (data.key?("line1") ? data["line1"] : ::Pago::UNSET),
      line2: (data.key?("line2") ? data["line2"] : ::Pago::UNSET)
    ),
    data
  )
end