Class: StickyIoRestfulApiV2025731::DataGetAddresses

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

Overview

DataGetAddresses 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:, first_name:, last_name:, email:, phone:, street:, street_2:, city:, state:, zip:, is_default:, created_at:, updated_at:, deleted_at:, country:, creator:, updator:, additional_properties: nil) ⇒ DataGetAddresses

Returns a new instance of DataGetAddresses.



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 117

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

  @id = id
  @first_name = first_name
  @last_name = last_name
  @email = email
  @phone = phone
  @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

Instance Attribute Details

#cityString

TODO: Write general description for this method

Returns:

  • (String)


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

def city
  @city
end

#countryString

TODO: Write general description for this method

Returns:

  • (String)


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

def country
  @country
end

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def created_at
  @created_at
end

#creatorCreator

TODO: Write general description for this method

Returns:



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

def creator
  @creator
end

#deleted_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def deleted_at
  @deleted_at
end

#emailString

TODO: Write general description for this method

Returns:

  • (String)


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

def email
  @email
end

#first_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

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/data_get_addresses.rb', line 14

def id
  @id
end

#is_defaultInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_default
  @is_default
end

#last_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def last_name
  @last_name
end

#phoneString

TODO: Write general description for this method

Returns:

  • (String)


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

def phone
  @phone
end

#stateString

TODO: Write general description for this method

Returns:

  • (String)


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

def state
  @state
end

#streetString

TODO: Write general description for this method

Returns:

  • (String)


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

def street
  @street
end

#street_2String

TODO: Write general description for this method

Returns:

  • (String)


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

def street_2
  @street_2
end

#updated_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def updated_at
  @updated_at
end

#updatorString

TODO: Write general description for this method

Returns:

  • (String)


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

def updator
  @updator
end

#zipString

TODO: Write general description for this method

Returns:

  • (String)


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

def zip
  @zip
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



145
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 145

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  first_name = hash.key?('first_name') ? hash['first_name'] : nil
  last_name = hash.key?('last_name') ? hash['last_name'] : nil
  email = hash.key?('email') ? hash['email'] : nil
  phone = hash.key?('phone') ? hash['phone'] : nil
  street = hash.key?('street') ? hash['street'] : nil
  street_2 = hash.key?('street_2') ? hash['street_2'] : nil
  city = hash.key?('city') ? hash['city'] : nil
  state = hash.key?('state') ? hash['state'] : nil
  zip = hash.key?('zip') ? hash['zip'] : nil
  is_default = hash.key?('is_default') ? hash['is_default'] : nil
  created_at = hash.key?('created_at') ? hash['created_at'] : nil
  updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil
  deleted_at = hash.key?('deleted_at') ? hash['deleted_at'] : nil
  country = hash.key?('country') ? hash['country'] : nil
  creator = Creator.from_hash(hash['creator']) if hash['creator']
  updator = hash.key?('updator') ? hash['updator'] : nil

  # 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.
  DataGetAddresses.new(id: id,
                       first_name: first_name,
                       last_name: last_name,
                       email: email,
                       phone: phone,
                       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.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 81

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['first_name'] = 'first_name'
  @_hash['last_name'] = 'last_name'
  @_hash['email'] = 'email'
  @_hash['phone'] = 'phone'
  @_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



109
110
111
112
113
114
115
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 109

def self.nullables
  %w[
    street_2
    deleted_at
    updator
  ]
end

.optionalsObject

An array for optional fields



104
105
106
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 104

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



206
207
208
209
210
211
212
213
214
215
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 206

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, first_name: #{@first_name.inspect}, last_name:"\
  " #{@last_name.inspect}, email: #{@email.inspect}, phone: #{@phone.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.



196
197
198
199
200
201
202
203
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_addresses.rb', line 196

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, first_name: #{@first_name}, last_name: #{@last_name}, email:"\
  " #{@email}, phone: #{@phone}, 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