Class: Authentik::Api::ObjectAttribute
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Authentik::Api::ObjectAttribute
- Defined in:
- lib/authentik/api/models/object_attribute.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#created ⇒ Object
Returns the value of attribute created.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#group ⇒ Object
Returns the value of attribute group.
-
#is_required ⇒ Object
Returns the value of attribute is_required.
-
#is_unique ⇒ Object
Returns the value of attribute is_unique.
-
#key ⇒ Object
Returns the value of attribute key.
-
#label ⇒ Object
Returns the value of attribute label.
-
#last_updated ⇒ Object
Returns the value of attribute last_updated.
-
#managed ⇒ Object
Objects that are managed by authentik.
-
#object_type ⇒ Object
Returns the value of attribute object_type.
-
#object_type_obj ⇒ Object
Returns the value of attribute object_type_obj.
-
#pk ⇒ Object
Returns the value of attribute pk.
-
#regex ⇒ Object
Returns the value of attribute regex.
-
#type ⇒ Object
Returns the value of attribute type.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ ObjectAttribute
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Methods inherited from ApiModelBase
_deserialize, #_to_hash, #to_body, #to_s
Constructor Details
#initialize(attributes = {}) ⇒ ObjectAttribute
Initializes the object
122 123 124 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 157 158 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 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 |
# File 'lib/authentik/api/models/object_attribute.rb', line 122 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::ObjectAttribute` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key acceptable_attribute_map = self.class.acceptable_attribute_map attributes = attributes.each_with_object({}) { |(k, v), h| if (!acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Authentik::Api::ObjectAttribute`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'pk') self.pk = attributes[:'pk'] else self.pk = nil end if attributes.key?(:'object_type') self.object_type = attributes[:'object_type'] else self.object_type = nil end if attributes.key?(:'object_type_obj') self.object_type_obj = attributes[:'object_type_obj'] else self.object_type_obj = nil end if attributes.key?(:'enabled') self.enabled = attributes[:'enabled'] else self.enabled = true end if attributes.key?(:'created') self.created = attributes[:'created'] else self.created = nil end if attributes.key?(:'key') self.key = attributes[:'key'] else self.key = nil end if attributes.key?(:'label') self.label = attributes[:'label'] else self.label = nil end if attributes.key?(:'last_updated') self.last_updated = attributes[:'last_updated'] else self.last_updated = nil end if attributes.key?(:'regex') self.regex = attributes[:'regex'] end if attributes.key?(:'type') self.type = attributes[:'type'] else self.type = nil end if attributes.key?(:'group') self.group = attributes[:'group'] end if attributes.key?(:'managed') self.managed = attributes[:'managed'] end if attributes.key?(:'is_unique') self.is_unique = attributes[:'is_unique'] end if attributes.key?(:'is_required') self.is_required = attributes[:'is_required'] end end |
Instance Attribute Details
#created ⇒ Object
Returns the value of attribute created.
20 21 22 |
# File 'lib/authentik/api/models/object_attribute.rb', line 20 def created @created end |
#enabled ⇒ Object
Returns the value of attribute enabled.
18 19 20 |
# File 'lib/authentik/api/models/object_attribute.rb', line 18 def enabled @enabled end |
#group ⇒ Object
Returns the value of attribute group.
32 33 34 |
# File 'lib/authentik/api/models/object_attribute.rb', line 32 def group @group end |
#is_required ⇒ Object
Returns the value of attribute is_required.
39 40 41 |
# File 'lib/authentik/api/models/object_attribute.rb', line 39 def is_required @is_required end |
#is_unique ⇒ Object
Returns the value of attribute is_unique.
37 38 39 |
# File 'lib/authentik/api/models/object_attribute.rb', line 37 def is_unique @is_unique end |
#key ⇒ Object
Returns the value of attribute key.
22 23 24 |
# File 'lib/authentik/api/models/object_attribute.rb', line 22 def key @key end |
#label ⇒ Object
Returns the value of attribute label.
24 25 26 |
# File 'lib/authentik/api/models/object_attribute.rb', line 24 def label @label end |
#last_updated ⇒ Object
Returns the value of attribute last_updated.
26 27 28 |
# File 'lib/authentik/api/models/object_attribute.rb', line 26 def last_updated @last_updated end |
#managed ⇒ Object
Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
35 36 37 |
# File 'lib/authentik/api/models/object_attribute.rb', line 35 def managed @managed end |
#object_type ⇒ Object
Returns the value of attribute object_type.
14 15 16 |
# File 'lib/authentik/api/models/object_attribute.rb', line 14 def object_type @object_type end |
#object_type_obj ⇒ Object
Returns the value of attribute object_type_obj.
16 17 18 |
# File 'lib/authentik/api/models/object_attribute.rb', line 16 def object_type_obj @object_type_obj end |
#pk ⇒ Object
Returns the value of attribute pk.
12 13 14 |
# File 'lib/authentik/api/models/object_attribute.rb', line 12 def pk @pk end |
#regex ⇒ Object
Returns the value of attribute regex.
28 29 30 |
# File 'lib/authentik/api/models/object_attribute.rb', line 28 def regex @regex end |
#type ⇒ Object
Returns the value of attribute type.
30 31 32 |
# File 'lib/authentik/api/models/object_attribute.rb', line 30 def type @type end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
84 85 86 |
# File 'lib/authentik/api/models/object_attribute.rb', line 84 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
89 90 91 |
# File 'lib/authentik/api/models/object_attribute.rb', line 89 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/authentik/api/models/object_attribute.rb', line 64 def self.attribute_map { :'pk' => :'pk', :'object_type' => :'object_type', :'object_type_obj' => :'object_type_obj', :'enabled' => :'enabled', :'created' => :'created', :'key' => :'key', :'label' => :'label', :'last_updated' => :'last_updated', :'regex' => :'regex', :'type' => :'type', :'group' => :'group', :'managed' => :'managed', :'is_unique' => :'is_unique', :'is_required' => :'is_required' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/authentik/api/models/object_attribute.rb', line 382 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
114 115 116 117 118 |
# File 'lib/authentik/api/models/object_attribute.rb', line 114 def self.openapi_nullable Set.new([ :'managed', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/authentik/api/models/object_attribute.rb', line 94 def self.openapi_types { :'pk' => :'String', :'object_type' => :'String', :'object_type_obj' => :'ContentType', :'enabled' => :'Boolean', :'created' => :'Time', :'key' => :'String', :'label' => :'String', :'last_updated' => :'Time', :'regex' => :'String', :'type' => :'ObjectAttributeTypeEnum', :'group' => :'String', :'managed' => :'String', :'is_unique' => :'Boolean', :'is_required' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
# File 'lib/authentik/api/models/object_attribute.rb', line 348 def ==(o) return true if self.equal?(o) self.class == o.class && pk == o.pk && object_type == o.object_type && object_type_obj == o.object_type_obj && enabled == o.enabled && created == o.created && key == o.key && label == o.label && last_updated == o.last_updated && regex == o.regex && type == o.type && group == o.group && managed == o.managed && is_unique == o.is_unique && is_required == o.is_required end |
#eql?(o) ⇒ Boolean
369 370 371 |
# File 'lib/authentik/api/models/object_attribute.rb', line 369 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
375 376 377 |
# File 'lib/authentik/api/models/object_attribute.rb', line 375 def hash [pk, object_type, object_type_obj, enabled, created, key, label, last_updated, regex, type, group, managed, is_unique, is_required].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/authentik/api/models/object_attribute.rb', line 213 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @pk.nil? invalid_properties.push('invalid value for "pk", pk cannot be nil.') end if @object_type.nil? invalid_properties.push('invalid value for "object_type", object_type cannot be nil.') end if @object_type_obj.nil? invalid_properties.push('invalid value for "object_type_obj", object_type_obj cannot be nil.') end if @created.nil? invalid_properties.push('invalid value for "created", created cannot be nil.') end if @key.nil? invalid_properties.push('invalid value for "key", key cannot be nil.') end if @label.nil? invalid_properties.push('invalid value for "label", label cannot be nil.') end if @last_updated.nil? invalid_properties.push('invalid value for "last_updated", last_updated cannot be nil.') end if @type.nil? invalid_properties.push('invalid value for "type", type cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/authentik/api/models/object_attribute.rb', line 404 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/authentik/api/models/object_attribute.rb', line 253 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @pk.nil? return false if @object_type.nil? return false if @object_type_obj.nil? return false if @created.nil? return false if @key.nil? return false if @label.nil? return false if @last_updated.nil? return false if @type.nil? true end |