Class: Authentik::Api::GrantRequest
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- Authentik::Api::GrantRequest
- Defined in:
- lib/authentik/api/models/grant_request.rb
Overview
Mixin to validate that a valid enterprise license exists before allowing to save the object
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#created ⇒ Object
Returns the value of attribute created.
-
#created_by ⇒ Object
Returns the value of attribute created_by.
-
#expires ⇒ Object
Returns the value of attribute expires.
-
#fulfiller_data ⇒ Object
Returns the value of attribute fulfiller_data.
-
#is_active ⇒ Object
Returns the value of attribute is_active.
-
#requester_data ⇒ Object
Returns the value of attribute requester_data.
-
#revoked_by ⇒ Object
Returns the value of attribute revoked_by.
-
#status ⇒ Object
Returns the value of attribute status.
-
#target_objs ⇒ Object
Returns the value of attribute target_objs.
-
#targets ⇒ Object
Returns the value of attribute targets.
-
#uuid ⇒ Object
Returns the value of attribute uuid.
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 = {}) ⇒ GrantRequest
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 = {}) ⇒ GrantRequest
Initializes the object
110 111 112 113 114 115 116 117 118 119 120 121 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 |
# File 'lib/authentik/api/models/grant_request.rb', line 110 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::GrantRequest` 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::GrantRequest`. 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?(:'created') self.created = attributes[:'created'] else self.created = nil end if attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] else self.created_by = nil end if attributes.key?(:'requester_data') if (value = attributes[:'requester_data']).is_a?(Hash) self.requester_data = value end end if attributes.key?(:'fulfiller_data') if (value = attributes[:'fulfiller_data']).is_a?(Hash) self.fulfiller_data = value end end if attributes.key?(:'revoked_by') self.revoked_by = attributes[:'revoked_by'] else self.revoked_by = nil end if attributes.key?(:'is_active') self.is_active = attributes[:'is_active'] else self.is_active = nil end if attributes.key?(:'expires') self.expires = attributes[:'expires'] end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'targets') if (value = attributes[:'targets']).is_a?(Array) self.targets = value end else self.targets = nil end if attributes.key?(:'target_objs') if (value = attributes[:'target_objs']).is_a?(Array) self.target_objs = value end else self.target_objs = nil end if attributes.key?(:'uuid') self.uuid = attributes[:'uuid'] end end |
Instance Attribute Details
#created ⇒ Object
Returns the value of attribute created.
13 14 15 |
# File 'lib/authentik/api/models/grant_request.rb', line 13 def created @created end |
#created_by ⇒ Object
Returns the value of attribute created_by.
15 16 17 |
# File 'lib/authentik/api/models/grant_request.rb', line 15 def created_by @created_by end |
#expires ⇒ Object
Returns the value of attribute expires.
25 26 27 |
# File 'lib/authentik/api/models/grant_request.rb', line 25 def expires @expires end |
#fulfiller_data ⇒ Object
Returns the value of attribute fulfiller_data.
19 20 21 |
# File 'lib/authentik/api/models/grant_request.rb', line 19 def fulfiller_data @fulfiller_data end |
#is_active ⇒ Object
Returns the value of attribute is_active.
23 24 25 |
# File 'lib/authentik/api/models/grant_request.rb', line 23 def is_active @is_active end |
#requester_data ⇒ Object
Returns the value of attribute requester_data.
17 18 19 |
# File 'lib/authentik/api/models/grant_request.rb', line 17 def requester_data @requester_data end |
#revoked_by ⇒ Object
Returns the value of attribute revoked_by.
21 22 23 |
# File 'lib/authentik/api/models/grant_request.rb', line 21 def revoked_by @revoked_by end |
#status ⇒ Object
Returns the value of attribute status.
27 28 29 |
# File 'lib/authentik/api/models/grant_request.rb', line 27 def status @status end |
#target_objs ⇒ Object
Returns the value of attribute target_objs.
31 32 33 |
# File 'lib/authentik/api/models/grant_request.rb', line 31 def target_objs @target_objs end |
#targets ⇒ Object
Returns the value of attribute targets.
29 30 31 |
# File 'lib/authentik/api/models/grant_request.rb', line 29 def targets @targets end |
#uuid ⇒ Object
Returns the value of attribute uuid.
33 34 35 |
# File 'lib/authentik/api/models/grant_request.rb', line 33 def uuid @uuid end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
75 76 77 |
# File 'lib/authentik/api/models/grant_request.rb', line 75 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
80 81 82 |
# File 'lib/authentik/api/models/grant_request.rb', line 80 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/authentik/api/models/grant_request.rb', line 58 def self.attribute_map { :'created' => :'created', :'created_by' => :'created_by', :'requester_data' => :'requester_data', :'fulfiller_data' => :'fulfiller_data', :'revoked_by' => :'revoked_by', :'is_active' => :'is_active', :'expires' => :'expires', :'status' => :'status', :'targets' => :'targets', :'target_objs' => :'target_objs', :'uuid' => :'uuid' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 |
# File 'lib/authentik/api/models/grant_request.rb', line 344 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
102 103 104 105 106 |
# File 'lib/authentik/api/models/grant_request.rb', line 102 def self.openapi_nullable Set.new([ :'expires', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/authentik/api/models/grant_request.rb', line 85 def self.openapi_types { :'created' => :'Time', :'created_by' => :'PartialUser', :'requester_data' => :'Hash<String, Object>', :'fulfiller_data' => :'Hash<String, Object>', :'revoked_by' => :'PartialUser', :'is_active' => :'Boolean', :'expires' => :'Time', :'status' => :'RequestStatus', :'targets' => :'Array<String>', :'target_objs' => :'Array<RequestableTarget>', :'uuid' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 |
# File 'lib/authentik/api/models/grant_request.rb', line 313 def ==(o) return true if self.equal?(o) self.class == o.class && created == o.created && created_by == o.created_by && requester_data == o.requester_data && fulfiller_data == o.fulfiller_data && revoked_by == o.revoked_by && is_active == o.is_active && expires == o.expires && status == o.status && targets == o.targets && target_objs == o.target_objs && uuid == o.uuid end |
#eql?(o) ⇒ Boolean
331 332 333 |
# File 'lib/authentik/api/models/grant_request.rb', line 331 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
337 338 339 |
# File 'lib/authentik/api/models/grant_request.rb', line 337 def hash [created, created_by, requester_data, fulfiller_data, revoked_by, is_active, expires, status, targets, target_objs, uuid].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
193 194 195 196 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 |
# File 'lib/authentik/api/models/grant_request.rb', line 193 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @created.nil? invalid_properties.push('invalid value for "created", created cannot be nil.') end if @created_by.nil? invalid_properties.push('invalid value for "created_by", created_by cannot be nil.') end if @revoked_by.nil? invalid_properties.push('invalid value for "revoked_by", revoked_by cannot be nil.') end if @is_active.nil? invalid_properties.push('invalid value for "is_active", is_active cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @targets.nil? invalid_properties.push('invalid value for "targets", targets cannot be nil.') end if @target_objs.nil? invalid_properties.push('invalid value for "target_objs", target_objs cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/authentik/api/models/grant_request.rb', line 366 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
229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/authentik/api/models/grant_request.rb', line 229 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @created.nil? return false if @created_by.nil? return false if @revoked_by.nil? return false if @is_active.nil? return false if @status.nil? return false if @targets.nil? return false if @target_objs.nil? true end |