Class: Verizon::EsimGlobalDeviceList

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

Overview

EsimGlobalDeviceList 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, provisioning_status_filter: SKIP, profile_status_filter: SKIP, carrier_name_filter: SKIP, device_filter: SKIP) ⇒ EsimGlobalDeviceList

Returns a new instance of EsimGlobalDeviceList.



59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/verizon/models/esim_global_device_list.rb', line 59

def initialize(account_name: SKIP, provisioning_status_filter: SKIP,
               profile_status_filter: SKIP, carrier_name_filter: SKIP,
               device_filter: SKIP)
  @account_name =  unless  == SKIP
  unless provisioning_status_filter == SKIP
    @provisioning_status_filter =
      provisioning_status_filter
  end
  @profile_status_filter = profile_status_filter unless profile_status_filter == SKIP
  @carrier_name_filter = carrier_name_filter unless carrier_name_filter == SKIP
  @device_filter = device_filter unless device_filter == SKIP
end

Instance Attribute Details

#account_nameString

The numeric name of the account.

Returns:

  • (String)


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

def 
  @account_name
end

#carrier_name_filterString

The cellular service provider.

Returns:

  • (String)


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

def carrier_name_filter
  @carrier_name_filter
end

#device_filterArray[Object]

An array of device identifiers to filter the list.

Returns:

  • (Array[Object])


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

def device_filter
  @device_filter
end

#profile_status_filterProfileStatusFilter

The last status of the device’s profile as a filter.

Returns:



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

def profile_status_filter
  @profile_status_filter
end

#provisioning_status_filterProvisioningStatusFilter

The last status of the device as a list filter.



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

def provisioning_status_filter
  @provisioning_status_filter
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
   = hash.key?('accountName') ? hash['accountName'] : SKIP
  provisioning_status_filter =
    hash.key?('provisioningStatusFilter') ? hash['provisioningStatusFilter'] : SKIP
  profile_status_filter =
    hash.key?('profileStatusFilter') ? hash['profileStatusFilter'] : SKIP
  carrier_name_filter =
    hash.key?('carrierNameFilter') ? hash['carrierNameFilter'] : SKIP
  device_filter = hash.key?('deviceFilter') ? APIHelper.deserialize_union_type(
    UnionTypeLookUp.get(:EsimGlobalDeviceListDeviceFilter), hash['deviceFilter']
  ) : SKIP

  # Create object from extracted values.
  EsimGlobalDeviceList.new(account_name: ,
                           provisioning_status_filter: provisioning_status_filter,
                           profile_status_filter: profile_status_filter,
                           carrier_name_filter: carrier_name_filter,
                           device_filter: device_filter)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/verizon/models/esim_global_device_list.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['account_name'] = 'accountName'
  @_hash['provisioning_status_filter'] = 'provisioningStatusFilter'
  @_hash['profile_status_filter'] = 'profileStatusFilter'
  @_hash['carrier_name_filter'] = 'carrierNameFilter'
  @_hash['device_filter'] = 'deviceFilter'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/verizon/models/esim_global_device_list.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    account_name
    provisioning_status_filter
    profile_status_filter
    carrier_name_filter
    device_filter
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



98
99
100
101
102
103
104
# File 'lib/verizon/models/esim_global_device_list.rb', line 98

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.



115
116
117
118
119
120
121
# File 'lib/verizon/models/esim_global_device_list.rb', line 115

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

#to_sObject

Provides a human-readable string representation of the object.



107
108
109
110
111
112
# File 'lib/verizon/models/esim_global_device_list.rb', line 107

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