Class: StickyIoRestfulApiV2025731::AddressOneOf0

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb

Overview

AddressOneOf0 Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id: SKIP, uuid: SKIP, first_name: SKIP, last_name: SKIP, email: SKIP, phone: SKIP, phone_key: SKIP, street: SKIP, street_2: SKIP, city: SKIP, state: SKIP, zip: SKIP, is_default: SKIP, created_at: SKIP, updated_at: SKIP, deleted_at: SKIP, country: SKIP, creator: SKIP, updator: SKIP, additional_properties: nil) ⇒ AddressOneOf0

Returns a new instance of AddressOneOf0.



146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 146

def initialize(id: SKIP, uuid: SKIP, first_name: SKIP, last_name: SKIP,
               email: SKIP, phone: SKIP, phone_key: SKIP, street: SKIP,
               street_2: SKIP, city: SKIP, state: SKIP, zip: SKIP,
               is_default: SKIP, created_at: SKIP, updated_at: SKIP,
               deleted_at: SKIP, country: SKIP, creator: SKIP,
               updator: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id unless id == SKIP
  @uuid = uuid unless uuid == SKIP
  @first_name = first_name unless first_name == SKIP
  @last_name = last_name unless last_name == SKIP
  @email = email unless email == SKIP
  @phone = phone unless phone == SKIP
  @phone_key = phone_key unless phone_key == SKIP
  @street = street unless street == SKIP
  @street_2 = street_2 unless street_2 == SKIP
  @city = city unless city == SKIP
  @state = state unless state == SKIP
  @zip = zip unless zip == SKIP
  @is_default = is_default unless is_default == SKIP
  @created_at = created_at unless created_at == SKIP
  @updated_at = updated_at unless updated_at == SKIP
  @deleted_at = deleted_at unless deleted_at == SKIP
  @country = country unless country == SKIP
  @creator = creator unless creator == SKIP
  @updator = updator unless updator == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#cityString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 50

def city
  @city
end

#countryString

TODO: Write general description for this method

Returns:

  • (String)


78
79
80
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 78

def country
  @country
end

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 66

def created_at
  @created_at
end

#creatorObject

TODO: Write general description for this method

Returns:

  • (Object)


82
83
84
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 82

def creator
  @creator
end

#deleted_atString

TODO: Write general description for this method

Returns:

  • (String)


74
75
76
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 74

def deleted_at
  @deleted_at
end

#emailString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 30

def email
  @email
end

#first_nameString

TODO: Write general description for this method

Returns:

  • (String)


22
23
24
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 22

def first_name
  @first_name
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 14

def id
  @id
end

#is_defaultInteger

TODO: Write general description for this method

Returns:

  • (Integer)


62
63
64
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 62

def is_default
  @is_default
end

#last_nameString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 26

def last_name
  @last_name
end

#phoneString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 34

def phone
  @phone
end

#phone_keyString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 38

def phone_key
  @phone_key
end

#stateString

TODO: Write general description for this method

Returns:

  • (String)


54
55
56
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 54

def state
  @state
end

#streetString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 42

def street
  @street
end

#street_2String

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 46

def street_2
  @street_2
end

#updated_atString

TODO: Write general description for this method

Returns:

  • (String)


70
71
72
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 70

def updated_at
  @updated_at
end

#updatorObject

TODO: Write general description for this method

Returns:

  • (Object)


86
87
88
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 86

def updator
  @updator
end

#uuidString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 18

def uuid
  @uuid
end

#zipString

TODO: Write general description for this method

Returns:

  • (String)


58
59
60
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 58

def zip
  @zip
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 178

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : SKIP
  uuid = hash.key?('uuid') ? hash['uuid'] : SKIP
  first_name = hash.key?('first_name') ? hash['first_name'] : SKIP
  last_name = hash.key?('last_name') ? hash['last_name'] : SKIP
  email = hash.key?('email') ? hash['email'] : SKIP
  phone = hash.key?('phone') ? hash['phone'] : SKIP
  phone_key = hash.key?('phone_key') ? hash['phone_key'] : SKIP
  street = hash.key?('street') ? hash['street'] : SKIP
  street_2 = hash.key?('street_2') ? hash['street_2'] : SKIP
  city = hash.key?('city') ? hash['city'] : SKIP
  state = hash.key?('state') ? hash['state'] : SKIP
  zip = hash.key?('zip') ? hash['zip'] : SKIP
  is_default = hash.key?('is_default') ? hash['is_default'] : SKIP
  created_at = hash.key?('created_at') ? hash['created_at'] : SKIP
  updated_at = hash.key?('updated_at') ? hash['updated_at'] : SKIP
  deleted_at = hash.key?('deleted_at') ? hash['deleted_at'] : SKIP
  country = hash.key?('country') ? hash['country'] : SKIP
  creator = hash.key?('creator') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:AddressOneOf0Creator), hash['creator']
  ) : SKIP
  updator = hash.key?('updator') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:AddressOneOf0Updator), hash['updator']
  ) : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  AddressOneOf0.new(id: id,
                    uuid: uuid,
                    first_name: first_name,
                    last_name: last_name,
                    email: email,
                    phone: phone,
                    phone_key: phone_key,
                    street: street,
                    street_2: street_2,
                    city: city,
                    state: state,
                    zip: zip,
                    is_default: is_default,
                    created_at: created_at,
                    updated_at: updated_at,
                    deleted_at: deleted_at,
                    country: country,
                    creator: creator,
                    updator: updator,
                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 89

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['uuid'] = 'uuid'
  @_hash['first_name'] = 'first_name'
  @_hash['last_name'] = 'last_name'
  @_hash['email'] = 'email'
  @_hash['phone'] = 'phone'
  @_hash['phone_key'] = 'phone_key'
  @_hash['street'] = 'street'
  @_hash['street_2'] = 'street_2'
  @_hash['city'] = 'city'
  @_hash['state'] = 'state'
  @_hash['zip'] = 'zip'
  @_hash['is_default'] = 'is_default'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['deleted_at'] = 'deleted_at'
  @_hash['country'] = 'country'
  @_hash['creator'] = 'creator'
  @_hash['updator'] = 'updator'
  @_hash
end

.nullablesObject

An array for nullable fields



139
140
141
142
143
144
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 139

def self.nullables
  %w[
    street_2
    deleted_at
  ]
end

.optionalsObject

An array for optional fields



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 114

def self.optionals
  %w[
    id
    uuid
    first_name
    last_name
    email
    phone
    phone_key
    street
    street_2
    city
    state
    zip
    is_default
    created_at
    updated_at
    deleted_at
    country
    creator
    updator
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (AddressOneOf0 | Hash)

    value against the validation is performed.



238
239
240
241
242
243
244
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 238

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



258
259
260
261
262
263
264
265
266
267
268
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 258

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, uuid: #{@uuid.inspect}, first_name:"\
  " #{@first_name.inspect}, last_name: #{@last_name.inspect}, email: #{@email.inspect}, phone:"\
  " #{@phone.inspect}, phone_key: #{@phone_key.inspect}, street: #{@street.inspect}, street_2:"\
  " #{@street_2.inspect}, city: #{@city.inspect}, state: #{@state.inspect}, zip:"\
  " #{@zip.inspect}, is_default: #{@is_default.inspect}, created_at: #{@created_at.inspect},"\
  " updated_at: #{@updated_at.inspect}, deleted_at: #{@deleted_at.inspect}, country:"\
  " #{@country.inspect}, creator: #{@creator.inspect}, updator: #{@updator.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



247
248
249
250
251
252
253
254
255
# File 'lib/sticky_io_restful_api_v2025731/models/address_one_of0.rb', line 247

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, uuid: #{@uuid}, first_name: #{@first_name}, last_name:"\
  " #{@last_name}, email: #{@email}, phone: #{@phone}, phone_key: #{@phone_key}, street:"\
  " #{@street}, street_2: #{@street_2}, city: #{@city}, state: #{@state}, zip: #{@zip},"\
  " is_default: #{@is_default}, created_at: #{@created_at}, updated_at: #{@updated_at},"\
  " deleted_at: #{@deleted_at}, country: #{@country}, creator: #{@creator}, updator:"\
  " #{@updator}, additional_properties: #{@additional_properties}>"
end