Class: Zernio::CreatePhoneNumberPortInRequestEndUser

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb

Overview

End-user / current-carrier account info that authorizes the port. The losing carrier matches every field against its records and rejects the whole port on a mismatch — enter values exactly as they appear on the carrier bill.

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ CreatePhoneNumberPortInRequestEndUser

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
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
194
195
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 122

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::CreatePhoneNumberPortInRequestEndUser` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::CreatePhoneNumberPortInRequestEndUser`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'entity_name')
    self.entity_name = attributes[:'entity_name']
  else
    self.entity_name = nil
  end

  if attributes.key?(:'auth_person_name')
    self.auth_person_name = attributes[:'auth_person_name']
  else
    self.auth_person_name = nil
  end

  if attributes.key?(:'billing_phone_number')
    self.billing_phone_number = attributes[:'billing_phone_number']
  end

  if attributes.key?(:'account_number')
    self. = attributes[:'account_number']
  else
    self. = nil
  end

  if attributes.key?(:'pin_passcode')
    self.pin_passcode = attributes[:'pin_passcode']
  end

  if attributes.key?(:'street_address')
    self.street_address = attributes[:'street_address']
  else
    self.street_address = nil
  end

  if attributes.key?(:'extended_address')
    self.extended_address = attributes[:'extended_address']
  end

  if attributes.key?(:'locality')
    self.locality = attributes[:'locality']
  else
    self.locality = nil
  end

  if attributes.key?(:'administrative_area')
    self.administrative_area = attributes[:'administrative_area']
  else
    self.administrative_area = nil
  end

  if attributes.key?(:'postal_code')
    self.postal_code = attributes[:'postal_code']
  else
    self.postal_code = nil
  end

  if attributes.key?(:'country_code')
    self.country_code = attributes[:'country_code']
  else
    self.country_code = nil
  end
end

Instance Attribute Details

#account_numberObject

Account number with the losing carrier — required (carriers reject ports without it; on prepaid mobile plans it is often the phone number itself).



29
30
31
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 29

def 
  @account_number
end

#administrative_areaObject

2-letter US state / CA province code (full names are accepted and normalized).



41
42
43
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 41

def administrative_area
  @administrative_area
end

#auth_person_nameObject

Full name (first + last) of the person authorizing the port — must match the LOA signature.



23
24
25
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 23

def auth_person_name
  @auth_person_name
end

#billing_phone_numberObject

Phone number on the losing carrier's bill. Defaults to the ported number itself on single-number orders. Validated as a real phone number when present.



26
27
28
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 26

def billing_phone_number
  @billing_phone_number
end

#country_codeObject

Returns the value of attribute country_code.



46
47
48
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 46

def country_code
  @country_code
end

#entity_nameObject

Account holder / business name, as on the carrier account.



20
21
22
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 20

def entity_name
  @entity_name
end

#extended_addressObject

Returns the value of attribute extended_address.



36
37
38
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 36

def extended_address
  @extended_address
end

#localityObject

Returns the value of attribute locality.



38
39
40
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 38

def locality
  @locality
end

#pin_passcodeObject

Transfer PIN. Required for mobile numbers (wireless carriers reject PIN-less ports). Forwarded to the carrier, never stored.



32
33
34
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 32

def pin_passcode
  @pin_passcode
end

#postal_codeObject

US ZIP (5 digits) or Canadian postal code, matching countryCode.



44
45
46
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 44

def postal_code
  @postal_code
end

#street_addressObject

Returns the value of attribute street_address.



34
35
36
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 34

def street_address
  @street_address
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



88
89
90
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 88

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



93
94
95
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 93

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 71

def self.attribute_map
  {
    :'entity_name' => :'entityName',
    :'auth_person_name' => :'authPersonName',
    :'billing_phone_number' => :'billingPhoneNumber',
    :'account_number' => :'accountNumber',
    :'pin_passcode' => :'pinPasscode',
    :'street_address' => :'streetAddress',
    :'extended_address' => :'extendedAddress',
    :'locality' => :'locality',
    :'administrative_area' => :'administrativeArea',
    :'postal_code' => :'postalCode',
    :'country_code' => :'countryCode'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 377

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



115
116
117
118
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 115

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 98

def self.openapi_types
  {
    :'entity_name' => :'String',
    :'auth_person_name' => :'String',
    :'billing_phone_number' => :'String',
    :'account_number' => :'String',
    :'pin_passcode' => :'String',
    :'street_address' => :'String',
    :'extended_address' => :'String',
    :'locality' => :'String',
    :'administrative_area' => :'String',
    :'postal_code' => :'String',
    :'country_code' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 346

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      entity_name == o.entity_name &&
      auth_person_name == o.auth_person_name &&
      billing_phone_number == o.billing_phone_number &&
       == o. &&
      pin_passcode == o.pin_passcode &&
      street_address == o.street_address &&
      extended_address == o.extended_address &&
      locality == o.locality &&
      administrative_area == o.administrative_area &&
      postal_code == o.postal_code &&
      country_code == o.country_code
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


364
365
366
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 364

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



370
371
372
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 370

def hash
  [entity_name, auth_person_name, billing_phone_number, , pin_passcode, street_address, extended_address, locality, administrative_area, postal_code, country_code].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



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
235
236
237
238
239
240
241
242
243
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 199

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @entity_name.nil?
    invalid_properties.push('invalid value for "entity_name", entity_name cannot be nil.')
  end

  if @auth_person_name.nil?
    invalid_properties.push('invalid value for "auth_person_name", auth_person_name cannot be nil.')
  end

  if @account_number.nil?
    invalid_properties.push('invalid value for "account_number", account_number cannot be nil.')
  end

  if @street_address.nil?
    invalid_properties.push('invalid value for "street_address", street_address cannot be nil.')
  end

  if @locality.nil?
    invalid_properties.push('invalid value for "locality", locality cannot be nil.')
  end

  if @administrative_area.nil?
    invalid_properties.push('invalid value for "administrative_area", administrative_area cannot be nil.')
  end

  if @postal_code.nil?
    invalid_properties.push('invalid value for "postal_code", postal_code cannot be nil.')
  end

  if @country_code.nil?
    invalid_properties.push('invalid value for "country_code", country_code cannot be nil.')
  end

  if @country_code.to_s.length > 2
    invalid_properties.push('invalid value for "country_code", the character length must be smaller than or equal to 2.')
  end

  if @country_code.to_s.length < 2
    invalid_properties.push('invalid value for "country_code", the character length must be greater than or equal to 2.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 399

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 247

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @entity_name.nil?
  return false if @auth_person_name.nil?
  return false if @account_number.nil?
  return false if @street_address.nil?
  return false if @locality.nil?
  return false if @administrative_area.nil?
  return false if @postal_code.nil?
  return false if @country_code.nil?
  country_code_validator = EnumAttributeValidator.new('String', ["US", "CA"])
  return false unless country_code_validator.valid?(@country_code)
  return false if @country_code.to_s.length > 2
  return false if @country_code.to_s.length < 2
  true
end