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



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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 133

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?(:'tax_identifier')
    self.tax_identifier = attributes[:'tax_identifier']
  end

  if attributes.key?(:'business_identifier')
    self.business_identifier = attributes[:'business_identifier']
  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']
  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

Region. Required for US/CA as the 2-letter state/province code (full names are accepted and normalized); optional elsewhere.



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

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

#business_identifierObject

Business registration id on the carrier account (EU ports).



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

def business_identifier
  @business_identifier
end

#country_codeObject

Service-address country (a supported port-in country).



53
54
55
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 53

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.



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

def extended_address
  @extended_address
end

#localityObject

Returns the value of attribute locality.



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

def locality
  @locality
end

#pin_passcodeObject

Transfer PIN. Required for US/CA mobile numbers (wireless carriers reject PIN-less ports). Forwarded to the carrier, never stored. International porting codes (e.g. the UK PAC) go through requirements instead.



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

Postal code. Validated as a US ZIP / Canadian postal code for US/CA; free-form elsewhere.



50
51
52
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 50

def postal_code
  @postal_code
end

#street_addressObject

Returns the value of attribute street_address.



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

def street_address
  @street_address
end

#tax_identifierObject

Company tax id on the carrier account (EU ports, e.g. Spanish CIF).



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

def tax_identifier
  @tax_identifier
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



97
98
99
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 97

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



102
103
104
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 102

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 78

def self.attribute_map
  {
    :'entity_name' => :'entityName',
    :'auth_person_name' => :'authPersonName',
    :'billing_phone_number' => :'billingPhoneNumber',
    :'account_number' => :'accountNumber',
    :'pin_passcode' => :'pinPasscode',
    :'tax_identifier' => :'taxIdentifier',
    :'business_identifier' => :'businessIdentifier',
    :'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



419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 419

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



126
127
128
129
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 126

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

.openapi_typesObject

Attribute type mapping.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 107

def self.openapi_types
  {
    :'entity_name' => :'String',
    :'auth_person_name' => :'String',
    :'billing_phone_number' => :'String',
    :'account_number' => :'String',
    :'pin_passcode' => :'String',
    :'tax_identifier' => :'String',
    :'business_identifier' => :'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



386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 386

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 &&
      tax_identifier == o.tax_identifier &&
      business_identifier == o.business_identifier &&
      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


406
407
408
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 406

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



412
413
414
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 412

def hash
  [entity_name, auth_person_name, billing_phone_number, , pin_passcode, tax_identifier, business_identifier, 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



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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 216

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 !@tax_identifier.nil? && @tax_identifier.to_s.length > 50
    invalid_properties.push('invalid value for "tax_identifier", the character length must be smaller than or equal to 50.')
  end

  if !@business_identifier.nil? && @business_identifier.to_s.length > 50
    invalid_properties.push('invalid value for "business_identifier", the character length must be smaller than or equal to 50.')
  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 @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



441
442
443
444
445
446
447
448
449
450
451
452
453
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 441

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



268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/zernio-sdk/models/create_phone_number_port_in_request_end_user.rb', line 268

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 !@tax_identifier.nil? && @tax_identifier.to_s.length > 50
  return false if !@business_identifier.nil? && @business_identifier.to_s.length > 50
  return false if @street_address.nil?
  return false if @locality.nil?
  return false if @postal_code.nil?
  return false if @country_code.nil?
  country_code_validator = EnumAttributeValidator.new('String', ["US", "CA", "GB", "ES", "DE", "FR", "NL", "AU"])
  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