Class: Verizon::Accountid

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/verizon/models/accountid.rb

Overview

Accountid 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(account_name = SKIP, mtas_account_number = SKIP) ⇒ Accountid

Returns a new instance of Accountid.



41
42
43
44
# File 'lib/verizon/models/accountid.rb', line 41

def initialize( = SKIP,  = SKIP)
  @account_name =  unless  == SKIP
  @mtas_account_number =  unless  == SKIP
end

Instance Attribute Details

#account_nameString

The numeric name of the account and must include leading zeroes

Returns:

  • (String)


14
15
16
# File 'lib/verizon/models/accountid.rb', line 14

def 
  @account_name
end

#mtas_account_numberString

The numeric name of the account and must include leading zeroes

Returns:

  • (String)


18
19
20
# File 'lib/verizon/models/accountid.rb', line 18

def 
  @mtas_account_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/verizon/models/accountid.rb', line 47

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
   =
    hash.key?('mtasAccountNumber') ? hash['mtasAccountNumber'] : SKIP

  # Create object from extracted values.
  Accountid.new(,
                )
end

.namesObject

A mapping from model property names to API property names.



21
22
23
24
25
26
# File 'lib/verizon/models/accountid.rb', line 21

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['mtas_account_number'] = 'mtasAccountNumber'
  @_hash
end

.nullablesObject

An array for nullable fields



37
38
39
# File 'lib/verizon/models/accountid.rb', line 37

def self.nullables
  []
end

.optionalsObject

An array for optional fields



29
30
31
32
33
34
# File 'lib/verizon/models/accountid.rb', line 29

def self.optionals
  %w[
    account_name
    mtas_account_number
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:

  • The (Accountid | Hash)

    value against the validation is performed.



62
63
64
65
66
67
68
# File 'lib/verizon/models/accountid.rb', line 62

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.



78
79
80
81
82
# File 'lib/verizon/models/accountid.rb', line 78

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_name: #{@account_name.inspect}, mtas_account_number:"\
  " #{@mtas_account_number.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



71
72
73
74
75
# File 'lib/verizon/models/accountid.rb', line 71

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_name: #{@account_name}, mtas_account_number:"\
  " #{@mtas_account_number}>"
end