Class: CtdDocumentation::Policy
- Defined in:
- lib/ctd_documentation/models/policy.rb
Overview
Policy Model.
Instance Attribute Summary collapse
-
#action ⇒ Integer
TODO: Write general description for this method.
-
#active ⇒ TrueClass|FalseClass
TODO: Write general description for this method.
-
#approved_user_id ⇒ Integer
TODO: Write general description for this method.
-
#approved_username ⇒ String
TODO: Write general description for this method.
-
#categories ⇒ List of Integer
TODO: Write general description for this method.
-
#categories_access ⇒ List of Integer
TODO: Write general description for this method.
-
#cloud_reputation ⇒ Integer
TODO: Write general description for this method.
-
#created_user_id ⇒ Integer
TODO: Write general description for this method.
-
#created_username ⇒ String
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#full_match ⇒ TrueClass|FalseClass
TODO: Write general description for this method.
-
#hit_count ⇒ Integer
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#last_modified ⇒ String
TODO: Write general description for this method.
-
#last_user_modified ⇒ String
TODO: Write general description for this method.
-
#modified_user_id ⇒ Integer
TODO: Write general description for this method.
-
#modified_username ⇒ String
TODO: Write general description for this method.
-
#port_ranges ⇒ List of String
TODO: Write general description for this method.
-
#ports ⇒ List of String
TODO: Write general description for this method.
-
#protocols ⇒ List of String
TODO: Write general description for this method.
-
#resource_id ⇒ String
TODO: Write general description for this method.
-
#site_id ⇒ Integer
TODO: Write general description for this method.
-
#state ⇒ Integer
TODO: Write general description for this method.
-
#state_modified ⇒ String
TODO: Write general description for this method.
-
#timestamp ⇒ String
TODO: Write general description for this method.
-
#usage_percentage ⇒ Integer
TODO: Write general description for this method.
-
#valid ⇒ TrueClass|FalseClass
TODO: Write general description for this method.
-
#virtual_zones ⇒ VirtualZones
TODO: Write general description for this method.
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
Methods inherited from BaseModel
Constructor Details
#initialize(resource_id = SKIP, id = SKIP, site_id = SKIP, action = SKIP, active = SKIP, approved_user_id = SKIP, approved_username = SKIP, categories = SKIP, categories_access = SKIP, cloud_reputation = SKIP, created_user_id = SKIP, created_username = SKIP, description = SKIP, full_match = SKIP, hit_count = SKIP, port_ranges = SKIP, ports = SKIP, protocols = SKIP, valid = SKIP, state = SKIP, usage_percentage = SKIP, modified_user_id = SKIP, modified_username = SKIP, last_modified = SKIP, timestamp = SKIP, last_user_modified = SKIP, state_modified = SKIP, virtual_zones = SKIP) ⇒ Policy
Returns a new instance of Policy.
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
# File 'lib/ctd_documentation/models/policy.rb', line 197 def initialize(resource_id = SKIP, id = SKIP, site_id = SKIP, action = SKIP, active = SKIP, approved_user_id = SKIP, approved_username = SKIP, categories = SKIP, categories_access = SKIP, cloud_reputation = SKIP, created_user_id = SKIP, created_username = SKIP, description = SKIP, full_match = SKIP, hit_count = SKIP, port_ranges = SKIP, ports = SKIP, protocols = SKIP, valid = SKIP, state = SKIP, usage_percentage = SKIP, modified_user_id = SKIP, modified_username = SKIP, last_modified = SKIP, = SKIP, last_user_modified = SKIP, state_modified = SKIP, virtual_zones = SKIP) @resource_id = resource_id unless resource_id == SKIP @id = id unless id == SKIP @site_id = site_id unless site_id == SKIP @action = action unless action == SKIP @active = active unless active == SKIP @approved_user_id = approved_user_id unless approved_user_id == SKIP @approved_username = approved_username unless approved_username == SKIP @categories = categories unless categories == SKIP @categories_access = categories_access unless categories_access == SKIP @cloud_reputation = cloud_reputation unless cloud_reputation == SKIP @created_user_id = created_user_id unless created_user_id == SKIP @created_username = created_username unless created_username == SKIP @description = description unless description == SKIP @full_match = full_match unless full_match == SKIP @hit_count = hit_count unless hit_count == SKIP @port_ranges = port_ranges unless port_ranges == SKIP @ports = ports unless ports == SKIP @protocols = protocols unless protocols == SKIP @valid = valid unless valid == SKIP @state = state unless state == SKIP @usage_percentage = usage_percentage unless usage_percentage == SKIP @modified_user_id = modified_user_id unless modified_user_id == SKIP @modified_username = modified_username unless modified_username == SKIP @last_modified = last_modified unless last_modified == SKIP @timestamp = unless == SKIP @last_user_modified = last_user_modified unless last_user_modified == SKIP @state_modified = state_modified unless state_modified == SKIP @virtual_zones = virtual_zones unless virtual_zones == SKIP end |
Instance Attribute Details
#action ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/ctd_documentation/models/policy.rb', line 26 def action @action end |
#active ⇒ TrueClass|FalseClass
TODO: Write general description for this method
30 31 32 |
# File 'lib/ctd_documentation/models/policy.rb', line 30 def active @active end |
#approved_user_id ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/ctd_documentation/models/policy.rb', line 34 def approved_user_id @approved_user_id end |
#approved_username ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/ctd_documentation/models/policy.rb', line 38 def approved_username @approved_username end |
#categories ⇒ List of Integer
TODO: Write general description for this method
42 43 44 |
# File 'lib/ctd_documentation/models/policy.rb', line 42 def categories @categories end |
#categories_access ⇒ List of Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/ctd_documentation/models/policy.rb', line 46 def categories_access @categories_access end |
#cloud_reputation ⇒ Integer
TODO: Write general description for this method
50 51 52 |
# File 'lib/ctd_documentation/models/policy.rb', line 50 def cloud_reputation @cloud_reputation end |
#created_user_id ⇒ Integer
TODO: Write general description for this method
54 55 56 |
# File 'lib/ctd_documentation/models/policy.rb', line 54 def created_user_id @created_user_id end |
#created_username ⇒ String
TODO: Write general description for this method
58 59 60 |
# File 'lib/ctd_documentation/models/policy.rb', line 58 def created_username @created_username end |
#description ⇒ String
TODO: Write general description for this method
62 63 64 |
# File 'lib/ctd_documentation/models/policy.rb', line 62 def description @description end |
#full_match ⇒ TrueClass|FalseClass
TODO: Write general description for this method
66 67 68 |
# File 'lib/ctd_documentation/models/policy.rb', line 66 def full_match @full_match end |
#hit_count ⇒ Integer
TODO: Write general description for this method
70 71 72 |
# File 'lib/ctd_documentation/models/policy.rb', line 70 def hit_count @hit_count end |
#id ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/ctd_documentation/models/policy.rb', line 18 def id @id end |
#last_modified ⇒ String
TODO: Write general description for this method
106 107 108 |
# File 'lib/ctd_documentation/models/policy.rb', line 106 def last_modified @last_modified end |
#last_user_modified ⇒ String
TODO: Write general description for this method
114 115 116 |
# File 'lib/ctd_documentation/models/policy.rb', line 114 def last_user_modified @last_user_modified end |
#modified_user_id ⇒ Integer
TODO: Write general description for this method
98 99 100 |
# File 'lib/ctd_documentation/models/policy.rb', line 98 def modified_user_id @modified_user_id end |
#modified_username ⇒ String
TODO: Write general description for this method
102 103 104 |
# File 'lib/ctd_documentation/models/policy.rb', line 102 def modified_username @modified_username end |
#port_ranges ⇒ List of String
TODO: Write general description for this method
74 75 76 |
# File 'lib/ctd_documentation/models/policy.rb', line 74 def port_ranges @port_ranges end |
#ports ⇒ List of String
TODO: Write general description for this method
78 79 80 |
# File 'lib/ctd_documentation/models/policy.rb', line 78 def ports @ports end |
#protocols ⇒ List of String
TODO: Write general description for this method
82 83 84 |
# File 'lib/ctd_documentation/models/policy.rb', line 82 def protocols @protocols end |
#resource_id ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/ctd_documentation/models/policy.rb', line 14 def resource_id @resource_id end |
#site_id ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/ctd_documentation/models/policy.rb', line 22 def site_id @site_id end |
#state ⇒ Integer
TODO: Write general description for this method
90 91 92 |
# File 'lib/ctd_documentation/models/policy.rb', line 90 def state @state end |
#state_modified ⇒ String
TODO: Write general description for this method
118 119 120 |
# File 'lib/ctd_documentation/models/policy.rb', line 118 def state_modified @state_modified end |
#timestamp ⇒ String
TODO: Write general description for this method
110 111 112 |
# File 'lib/ctd_documentation/models/policy.rb', line 110 def @timestamp end |
#usage_percentage ⇒ Integer
TODO: Write general description for this method
94 95 96 |
# File 'lib/ctd_documentation/models/policy.rb', line 94 def usage_percentage @usage_percentage end |
#valid ⇒ TrueClass|FalseClass
TODO: Write general description for this method
86 87 88 |
# File 'lib/ctd_documentation/models/policy.rb', line 86 def valid @valid end |
#virtual_zones ⇒ VirtualZones
TODO: Write general description for this method
122 123 124 |
# File 'lib/ctd_documentation/models/policy.rb', line 122 def virtual_zones @virtual_zones end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 |
# File 'lib/ctd_documentation/models/policy.rb', line 256 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. resource_id = hash.key?('resource_id') ? hash['resource_id'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP site_id = hash.key?('site_id') ? hash['site_id'] : SKIP action = hash.key?('action') ? hash['action'] : SKIP active = hash.key?('active') ? hash['active'] : SKIP approved_user_id = hash.key?('approved_user_id') ? hash['approved_user_id'] : SKIP approved_username = hash.key?('approved_username') ? hash['approved_username'] : SKIP categories = hash.key?('categories') ? hash['categories'] : SKIP categories_access = hash.key?('categories_access') ? hash['categories_access'] : SKIP cloud_reputation = hash.key?('cloud_reputation') ? hash['cloud_reputation'] : SKIP created_user_id = hash.key?('created_user_id') ? hash['created_user_id'] : SKIP created_username = hash.key?('created_username') ? hash['created_username'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP full_match = hash.key?('full_match') ? hash['full_match'] : SKIP hit_count = hash.key?('hit_count') ? hash['hit_count'] : SKIP port_ranges = hash.key?('port_ranges') ? hash['port_ranges'] : SKIP ports = hash.key?('ports') ? hash['ports'] : SKIP protocols = hash.key?('protocols') ? hash['protocols'] : SKIP valid = hash.key?('valid') ? hash['valid'] : SKIP state = hash.key?('state') ? hash['state'] : SKIP usage_percentage = hash.key?('usage_percentage') ? hash['usage_percentage'] : SKIP modified_user_id = hash.key?('modified_user_id') ? hash['modified_user_id'] : SKIP modified_username = hash.key?('modified_username') ? hash['modified_username'] : SKIP last_modified = hash.key?('last_modified') ? hash['last_modified'] : SKIP = hash.key?('timestamp') ? hash['timestamp'] : SKIP last_user_modified = hash.key?('last_user_modified') ? hash['last_user_modified'] : SKIP state_modified = hash.key?('state_modified') ? hash['state_modified'] : SKIP virtual_zones = VirtualZones.from_hash(hash['virtual_zones']) if hash['virtual_zones'] # Create object from extracted values. Policy.new(resource_id, id, site_id, action, active, approved_user_id, approved_username, categories, categories_access, cloud_reputation, created_user_id, created_username, description, full_match, hit_count, port_ranges, ports, protocols, valid, state, usage_percentage, modified_user_id, modified_username, last_modified, , last_user_modified, state_modified, virtual_zones) end |
.names ⇒ Object
A mapping from model property names to API property names.
125 126 127 128 129 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 |
# File 'lib/ctd_documentation/models/policy.rb', line 125 def self.names @_hash = {} if @_hash.nil? @_hash['resource_id'] = 'resource_id' @_hash['id'] = 'id' @_hash['site_id'] = 'site_id' @_hash['action'] = 'action' @_hash['active'] = 'active' @_hash['approved_user_id'] = 'approved_user_id' @_hash['approved_username'] = 'approved_username' @_hash['categories'] = 'categories' @_hash['categories_access'] = 'categories_access' @_hash['cloud_reputation'] = 'cloud_reputation' @_hash['created_user_id'] = 'created_user_id' @_hash['created_username'] = 'created_username' @_hash['description'] = 'description' @_hash['full_match'] = 'full_match' @_hash['hit_count'] = 'hit_count' @_hash['port_ranges'] = 'port_ranges' @_hash['ports'] = 'ports' @_hash['protocols'] = 'protocols' @_hash['valid'] = 'valid' @_hash['state'] = 'state' @_hash['usage_percentage'] = 'usage_percentage' @_hash['modified_user_id'] = 'modified_user_id' @_hash['modified_username'] = 'modified_username' @_hash['last_modified'] = 'last_modified' @_hash['timestamp'] = 'timestamp' @_hash['last_user_modified'] = 'last_user_modified' @_hash['state_modified'] = 'state_modified' @_hash['virtual_zones'] = 'virtual_zones' @_hash end |
.nullables ⇒ Object
An array for nullable fields
193 194 195 |
# File 'lib/ctd_documentation/models/policy.rb', line 193 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File 'lib/ctd_documentation/models/policy.rb', line 159 def self.optionals %w[ resource_id id site_id action active approved_user_id approved_username categories categories_access cloud_reputation created_user_id created_username description full_match hit_count port_ranges ports protocols valid state usage_percentage modified_user_id modified_username last_modified timestamp last_user_modified state_modified virtual_zones ] end |