Class: Verizon::ResourceRule
- Defined in:
- lib/verizon/models/resource_rule.rb
Overview
ResourceRule Model.
Instance Attribute Summary collapse
-
#accountclientid ⇒ String
Not used in this release, future functionality.
-
#billingaccountid ⇒ String
The billing account ID.
-
#createdon ⇒ DateTime
Timestamp of the record.
-
#description ⇒ String
a short description.
-
#deviceid ⇒ String
This is a UUID value of the device created when the device is onboarded.
-
#disabled ⇒ TrueClass | FalseClass
This is a UUID value of the device created when the device is onboarded.
-
#foreignid ⇒ String
UUID of the ECPD account the user belongs to.
-
#id ⇒ String
UUID of the user record, assigned at creation.
-
#lastupdated ⇒ DateTime
Timestamp of the record.
-
#name ⇒ String
User defined name of the record.
-
#rulechain ⇒ Object
User defined name of the record.
-
#rulesyntax ⇒ String
The syntax of the rule and supports camel and json style syntaxes.
-
#version ⇒ String
The resource version.
-
#versionid ⇒ String
The UUID of the resource version.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(createdon:, foreignid:, lastupdated:, rulechain:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, description: SKIP, deviceid: SKIP, disabled: SKIP, id: SKIP, name: SKIP, rulesyntax: SKIP, version: SKIP) ⇒ ResourceRule
constructor
A new instance of ResourceRule.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_createdon ⇒ Object
- #to_custom_lastupdated ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(createdon:, foreignid:, lastupdated:, rulechain:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, description: SKIP, deviceid: SKIP, disabled: SKIP, id: SKIP, name: SKIP, rulesyntax: SKIP, version: SKIP) ⇒ ResourceRule
Returns a new instance of ResourceRule.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/verizon/models/resource_rule.rb', line 109 def initialize(createdon:, foreignid:, lastupdated:, rulechain:, versionid:, accountclientid: SKIP, billingaccountid: SKIP, description: SKIP, deviceid: SKIP, disabled: SKIP, id: SKIP, name: SKIP, rulesyntax: SKIP, version: SKIP) @accountclientid = accountclientid unless accountclientid == SKIP @billingaccountid = billingaccountid unless billingaccountid == SKIP @createdon = createdon @description = description unless description == SKIP @deviceid = deviceid unless deviceid == SKIP @disabled = disabled unless disabled == SKIP @foreignid = foreignid @id = id unless id == SKIP @lastupdated = lastupdated @name = name unless name == SKIP @rulechain = rulechain @rulesyntax = rulesyntax unless rulesyntax == SKIP @version = version unless version == SKIP @versionid = versionid end |
Instance Attribute Details
#accountclientid ⇒ String
Not used in this release, future functionality
15 16 17 |
# File 'lib/verizon/models/resource_rule.rb', line 15 def accountclientid @accountclientid end |
#billingaccountid ⇒ String
The billing account ID. This is the same value as the Account ID
19 20 21 |
# File 'lib/verizon/models/resource_rule.rb', line 19 def billingaccountid @billingaccountid end |
#createdon ⇒ DateTime
Timestamp of the record
23 24 25 |
# File 'lib/verizon/models/resource_rule.rb', line 23 def createdon @createdon end |
#description ⇒ String
a short description
27 28 29 |
# File 'lib/verizon/models/resource_rule.rb', line 27 def description @description end |
#deviceid ⇒ String
This is a UUID value of the device created when the device is onboarded
31 32 33 |
# File 'lib/verizon/models/resource_rule.rb', line 31 def deviceid @deviceid end |
#disabled ⇒ TrueClass | FalseClass
This is a UUID value of the device created when the device is onboarded
35 36 37 |
# File 'lib/verizon/models/resource_rule.rb', line 35 def disabled @disabled end |
#foreignid ⇒ String
UUID of the ECPD account the user belongs to
39 40 41 |
# File 'lib/verizon/models/resource_rule.rb', line 39 def foreignid @foreignid end |
#id ⇒ String
UUID of the user record, assigned at creation
43 44 45 |
# File 'lib/verizon/models/resource_rule.rb', line 43 def id @id end |
#lastupdated ⇒ DateTime
Timestamp of the record
47 48 49 |
# File 'lib/verizon/models/resource_rule.rb', line 47 def lastupdated @lastupdated end |
#name ⇒ String
User defined name of the record
51 52 53 |
# File 'lib/verizon/models/resource_rule.rb', line 51 def name @name end |
#rulechain ⇒ Object
User defined name of the record
55 56 57 |
# File 'lib/verizon/models/resource_rule.rb', line 55 def rulechain @rulechain end |
#rulesyntax ⇒ String
The syntax of the rule and supports camel and json style syntaxes
59 60 61 |
# File 'lib/verizon/models/resource_rule.rb', line 59 def rulesyntax @rulesyntax end |
#version ⇒ String
The resource version
63 64 65 |
# File 'lib/verizon/models/resource_rule.rb', line 63 def version @version end |
#versionid ⇒ String
The UUID of the resource version
67 68 69 |
# File 'lib/verizon/models/resource_rule.rb', line 67 def versionid @versionid end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
130 131 132 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 |
# File 'lib/verizon/models/resource_rule.rb', line 130 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. createdon = if hash.key?('createdon') (DateTimeHelper.from_rfc3339(hash['createdon']) if hash['createdon']) end foreignid = hash.key?('foreignid') ? hash['foreignid'] : nil lastupdated = if hash.key?('lastupdated') (DateTimeHelper.from_rfc3339(hash['lastupdated']) if hash['lastupdated']) end rulechain = hash.key?('rulechain') ? hash['rulechain'] : nil versionid = hash.key?('versionid') ? hash['versionid'] : nil accountclientid = hash.key?('accountclientid') ? hash['accountclientid'] : SKIP billingaccountid = hash.key?('billingaccountid') ? hash['billingaccountid'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP deviceid = hash.key?('deviceid') ? hash['deviceid'] : SKIP disabled = hash.key?('disabled') ? hash['disabled'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP rulesyntax = hash.key?('rulesyntax') ? hash['rulesyntax'] : SKIP version = hash.key?('version') ? hash['version'] : SKIP # Create object from extracted values. ResourceRule.new(createdon: createdon, foreignid: foreignid, lastupdated: lastupdated, rulechain: rulechain, versionid: versionid, accountclientid: accountclientid, billingaccountid: billingaccountid, description: description, deviceid: deviceid, disabled: disabled, id: id, name: name, rulesyntax: rulesyntax, version: version) end |
.names ⇒ Object
A mapping from model property names to API property names.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/verizon/models/resource_rule.rb', line 70 def self.names @_hash = {} if @_hash.nil? @_hash['accountclientid'] = 'accountclientid' @_hash['billingaccountid'] = 'billingaccountid' @_hash['createdon'] = 'createdon' @_hash['description'] = 'description' @_hash['deviceid'] = 'deviceid' @_hash['disabled'] = 'disabled' @_hash['foreignid'] = 'foreignid' @_hash['id'] = 'id' @_hash['lastupdated'] = 'lastupdated' @_hash['name'] = 'name' @_hash['rulechain'] = 'rulechain' @_hash['rulesyntax'] = 'rulesyntax' @_hash['version'] = 'version' @_hash['versionid'] = 'versionid' @_hash end |
.nullables ⇒ Object
An array for nullable fields
105 106 107 |
# File 'lib/verizon/models/resource_rule.rb', line 105 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/verizon/models/resource_rule.rb', line 90 def self.optionals %w[ accountclientid billingaccountid description deviceid disabled id name rulesyntax version ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
191 192 193 194 195 196 197 198 199 200 |
# File 'lib/verizon/models/resource_rule.rb', line 191 def inspect class_name = self.class.name.split('::').last "<#{class_name} accountclientid: #{@accountclientid.inspect}, billingaccountid:"\ " #{@billingaccountid.inspect}, createdon: #{@createdon.inspect}, description:"\ " #{@description.inspect}, deviceid: #{@deviceid.inspect}, disabled: #{@disabled.inspect},"\ " foreignid: #{@foreignid.inspect}, id: #{@id.inspect}, lastupdated:"\ " #{@lastupdated.inspect}, name: #{@name.inspect}, rulechain: #{@rulechain.inspect},"\ " rulesyntax: #{@rulesyntax.inspect}, version: #{@version.inspect}, versionid:"\ " #{@versionid.inspect}>" end |
#to_custom_createdon ⇒ Object
172 173 174 |
# File 'lib/verizon/models/resource_rule.rb', line 172 def to_custom_createdon DateTimeHelper.to_rfc3339(createdon) end |
#to_custom_lastupdated ⇒ Object
176 177 178 |
# File 'lib/verizon/models/resource_rule.rb', line 176 def to_custom_lastupdated DateTimeHelper.to_rfc3339(lastupdated) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
181 182 183 184 185 186 187 188 |
# File 'lib/verizon/models/resource_rule.rb', line 181 def to_s class_name = self.class.name.split('::').last "<#{class_name} accountclientid: #{@accountclientid}, billingaccountid:"\ " #{@billingaccountid}, createdon: #{@createdon}, description: #{@description}, deviceid:"\ " #{@deviceid}, disabled: #{@disabled}, foreignid: #{@foreignid}, id: #{@id}, lastupdated:"\ " #{@lastupdated}, name: #{@name}, rulechain: #{@rulechain}, rulesyntax: #{@rulesyntax},"\ " version: #{@version}, versionid: #{@versionid}>" end |