Class: Verizon::DeactivateDeviceProfileRequest

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

Overview

DeactivateDeviceProfileRequest Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(account_name = nil, reason_code = nil, devices = SKIP, carrier_name = SKIP, etf_waiver = true, check_fallback_profile = false) ⇒ DeactivateDeviceProfileRequest

Returns a new instance of DeactivateDeviceProfileRequest.



63
64
65
66
67
68
69
70
71
72
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 63

def initialize( = nil, reason_code = nil, devices = SKIP,
               carrier_name = SKIP, etf_waiver = true,
               check_fallback_profile = false)
  @account_name = 
  @reason_code = reason_code
  @devices = devices unless devices == SKIP
  @carrier_name = carrier_name unless carrier_name == SKIP
  @etf_waiver = etf_waiver unless etf_waiver == SKIP
  @check_fallback_profile = check_fallback_profile unless check_fallback_profile == SKIP
end

Instance Attribute Details

#account_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def 
  @account_name
end

#carrier_nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def carrier_name
  @carrier_name
end

#check_fallback_profileTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def check_fallback_profile
  @check_fallback_profile
end

#devicesArray[DeactivateDeviceList]

TODO: Write general description for this method

Returns:



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

def devices
  @devices
end

#etf_waiverTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def etf_waiver
  @etf_waiver
end

#reason_codeString

TODO: Write general description for this method

Returns:

  • (String)


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

def reason_code
  @reason_code
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 75

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : nil
  reason_code = hash.key?('reasonCode') ? hash['reasonCode'] : nil
  # Parameter is an array, so we need to iterate through it
  devices = nil
  unless hash['devices'].nil?
    devices = []
    hash['devices'].each do |structure|
      devices << (DeactivateDeviceList.from_hash(structure) if structure)
    end
  end

  devices = SKIP unless hash.key?('devices')
  carrier_name = hash.key?('carrierName') ? hash['carrierName'] : SKIP
  etf_waiver = hash['etfWaiver'] ||= true
  check_fallback_profile = hash['checkFallbackProfile'] ||= false

  # Create object from extracted values.
  DeactivateDeviceProfileRequest.new(,
                                     reason_code,
                                     devices,
                                     carrier_name,
                                     etf_waiver,
                                     check_fallback_profile)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['reason_code'] = 'reasonCode'
  @_hash['devices'] = 'devices'
  @_hash['carrier_name'] = 'carrierName'
  @_hash['etf_waiver'] = 'etfWaiver'
  @_hash['check_fallback_profile'] = 'checkFallbackProfile'
  @_hash
end

.nullablesObject

An array for nullable fields



59
60
61
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 59

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
# File 'lib/verizon/models/deactivate_device_profile_request.rb', line 49

def self.optionals
  %w[
    devices
    carrier_name
    etf_waiver
    check_fallback_profile
  ]
end