Class: Verizon::M5GBiactivateRequest

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

Overview

M5GBiactivateRequest 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, service_plan: SKIP, device_list_with_service_address: SKIP, sku_number: SKIP, public_ip_restriction: SKIP, carrier_name: SKIP, mdn_zip_code: SKIP, additional_properties: nil) ⇒ M5GBiactivateRequest

Returns a new instance of M5GBiactivateRequest.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 72

def initialize(account_name: SKIP, service_plan: SKIP,
               device_list_with_service_address: SKIP, sku_number: SKIP,
               public_ip_restriction: SKIP, carrier_name: SKIP,
               mdn_zip_code: SKIP, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @account_name =  unless  == SKIP
  @service_plan = service_plan unless service_plan == SKIP
  unless device_list_with_service_address == SKIP
    @device_list_with_service_address =
      device_list_with_service_address
  end
  @sku_number = sku_number unless sku_number == SKIP
  @public_ip_restriction = public_ip_restriction unless public_ip_restriction == SKIP
  @carrier_name = carrier_name unless carrier_name == SKIP
  @mdn_zip_code = mdn_zip_code unless mdn_zip_code == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_name
end

#carrier_nameString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 34

def carrier_name
  @carrier_name
end

#device_list_with_service_addressArray[Object]

TODO: Write general description for this method

Returns:

  • (Array[Object])


22
23
24
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 22

def device_list_with_service_address
  @device_list_with_service_address
end

#mdn_zip_codeString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 38

def mdn_zip_code
  @mdn_zip_code
end

#public_ip_restrictionString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 30

def public_ip_restriction
  @public_ip_restriction
end

#service_planString

TODO: Write general description for this method

Returns:

  • (String)


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

def service_plan
  @service_plan
end

#sku_numberString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 26

def sku_number
  @sku_number
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 93

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  service_plan = hash.key?('servicePlan') ? hash['servicePlan'] : SKIP
  device_list_with_service_address = hash.key?('deviceListWithServiceAddress') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:M5GBiactivateRequestDeviceListWithServiceAddress), hash['deviceListWithServiceAddress']
  ) : SKIP
  sku_number = hash.key?('skuNumber') ? hash['skuNumber'] : SKIP
  public_ip_restriction =
    hash.key?('publicIpRestriction') ? hash['publicIpRestriction'] : SKIP
  carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
  mdn_zip_code = hash.key?('mdnZipCode') ? hash['mdnZipCode'] : 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.
  M5GBiactivateRequest.new(account_name: ,
                           service_plan: service_plan,
                           device_list_with_service_address: device_list_with_service_address,
                           sku_number: sku_number,
                           public_ip_restriction: public_ip_restriction,
                           carrier_name: carrier_name,
                           mdn_zip_code: mdn_zip_code,
                           additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 41

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['service_plan'] = 'servicePlan'
  @_hash['device_list_with_service_address'] =
    'deviceListWithServiceAddress'
  @_hash['sku_number'] = 'skuNumber'
  @_hash['public_ip_restriction'] = 'publicIpRestriction'
  @_hash['carrier_name'] = 'carrierName'
  @_hash['mdn_zip_code'] = 'mdnZipCode'
  @_hash
end

.nullablesObject

An array for nullable fields



68
69
70
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 68

def self.nullables
  []
end

.optionalsObject

An array for optional fields



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 55

def self.optionals
  %w[
    account_name
    service_plan
    device_list_with_service_address
    sku_number
    public_ip_restriction
    carrier_name
    mdn_zip_code
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



128
129
130
131
132
133
134
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 128

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.



147
148
149
150
151
152
153
154
155
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 147

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} account_name: #{@account_name.inspect}, service_plan:"\
  " #{@service_plan.inspect}, device_list_with_service_address:"\
  " #{@device_list_with_service_address.inspect}, sku_number: #{@sku_number.inspect},"\
  " public_ip_restriction: #{@public_ip_restriction.inspect}, carrier_name:"\
  " #{@carrier_name.inspect}, mdn_zip_code: #{@mdn_zip_code.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



137
138
139
140
141
142
143
144
# File 'lib/verizon/models/m_5g_biactivate_request.rb', line 137

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} account_name: #{@account_name}, service_plan: #{@service_plan},"\
  " device_list_with_service_address: #{@device_list_with_service_address}, sku_number:"\
  " #{@sku_number}, public_ip_restriction: #{@public_ip_restriction}, carrier_name:"\
  " #{@carrier_name}, mdn_zip_code: #{@mdn_zip_code}, additional_properties:"\
  " #{@additional_properties}>"
end