Class: Pago::V2026_04::Models::AddressInput
- Inherits:
-
Model
- Object
- Model
- Pago::V2026_04::Models::AddressInput
show all
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary
collapse
- JSON_KEYS =
{
line1: "line1",
line2: "line2",
postal_code: "postal_code",
city: "city",
state: "state",
country: "country"
}.freeze
- REQUIRED_KEYS =
["country"].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(line1: ::Pago::UNSET, line2: ::Pago::UNSET, postal_code: ::Pago::UNSET, city: ::Pago::UNSET, state: ::Pago::UNSET, country:) ⇒ AddressInput
Returns a new instance of AddressInput.
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
# File 'lib/pago/v2026_04/models.rb', line 173
def initialize(
line1: ::Pago::UNSET,
line2: ::Pago::UNSET,
postal_code: ::Pago::UNSET,
city: ::Pago::UNSET,
state: ::Pago::UNSET,
country:
)
super()
assign(:line1, line1)
assign(:line2, line2)
assign(:postal_code, postal_code)
assign(:city, city)
assign(:state, state)
assign(:country, country)
end
|
Instance Attribute Details
#city ⇒ String?
165
166
167
|
# File 'lib/pago/v2026_04/models.rb', line 165
def city
@city
end
|
#country ⇒ String
171
172
173
|
# File 'lib/pago/v2026_04/models.rb', line 171
def country
@country
end
|
#line1 ⇒ String?
156
157
158
|
# File 'lib/pago/v2026_04/models.rb', line 156
def line1
@line1
end
|
#line2 ⇒ String?
159
160
161
|
# File 'lib/pago/v2026_04/models.rb', line 159
def line2
@line2
end
|
#postal_code ⇒ String?
162
163
164
|
# File 'lib/pago/v2026_04/models.rb', line 162
def postal_code
@postal_code
end
|
#state ⇒ String?
168
169
170
|
# File 'lib/pago/v2026_04/models.rb', line 168
def state
@state
end
|
Class Method Details
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
|
# File 'lib/pago/v2026_04/models.rb', line 192
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(
line1: (data.key?("line1") ? data["line1"] : ::Pago::UNSET),
line2: (data.key?("line2") ? data["line2"] : ::Pago::UNSET),
postal_code: (data.key?("postal_code") ? data["postal_code"] : ::Pago::UNSET),
city: (data.key?("city") ? data["city"] : ::Pago::UNSET),
state: (data.key?("state") ? data["state"] : ::Pago::UNSET),
country: (data.key?("country") ? data["country"] : ::Pago::UNSET)
),
data
)
end
|