Class: Authentik::Api::OAuth2DynamicClientRegistration

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/authentik/api/models/o_auth2_dynamic_client_registration.rb

Overview

Serializer for OAuth2DynamicClientRegistration

Defined Under Namespace

Classes: EnumAttributeValidator

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiModelBase

_deserialize, #_to_hash, #to_body, #to_s

Constructor Details

#initialize(attributes = {}) ⇒ OAuth2DynamicClientRegistration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 113

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `Authentik::Api::OAuth2DynamicClientRegistration` 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::OAuth2DynamicClientRegistration`. 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?(:'pbm_uuid')
    self.pbm_uuid = attributes[:'pbm_uuid']
  else
    self.pbm_uuid = nil
  end

  if attributes.key?(:'provider')
    self.provider = attributes[:'provider']
  else
    self.provider = nil
  end

  if attributes.key?(:'default_application_group')
    self.default_application_group = attributes[:'default_application_group']
  end

  if attributes.key?(:'override_authorization_flow')
    self.override_authorization_flow = attributes[:'override_authorization_flow']
  end

  if attributes.key?(:'override_invalidation_flow')
    self.override_invalidation_flow = attributes[:'override_invalidation_flow']
  end

  if attributes.key?(:'override_property_mappings')
    if (value = attributes[:'override_property_mappings']).is_a?(Array)
      self.override_property_mappings = value
    end
  end

  if attributes.key?(:'access_token_validity')
    self.access_token_validity = attributes[:'access_token_validity']
  end

  if attributes.key?(:'refresh_token_validity')
    self.refresh_token_validity = attributes[:'refresh_token_validity']
  end

  if attributes.key?(:'allowed_grant_types')
    if (value = attributes[:'allowed_grant_types']).is_a?(Array)
      self.allowed_grant_types = value
    end
  end

  if attributes.key?(:'policy_engine_mode')
    self.policy_engine_mode = attributes[:'policy_engine_mode']
  end
end

Instance Attribute Details

#access_token_validityObject

Maximum access token validity for registered clients (Format: hours=1;minutes=2;seconds=3).



29
30
31
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 29

def access_token_validity
  @access_token_validity
end

#allowed_grant_typesObject

If empty, all grant types are allowed.



35
36
37
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 35

def allowed_grant_types
  @allowed_grant_types
end

#default_application_groupObject

Group to assign to automatically created applications.



18
19
20
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 18

def default_application_group
  @default_application_group
end

#override_authorization_flowObject

Authorization flow applied to dynamically registered clients.



21
22
23
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 21

def override_authorization_flow
  @override_authorization_flow
end

#override_invalidation_flowObject

Returns the value of attribute override_invalidation_flow.



23
24
25
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 23

def override_invalidation_flow
  @override_invalidation_flow
end

#override_property_mappingsObject

Scope mappings applied to dynamically registered clients.



26
27
28
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 26

def override_property_mappings
  @override_property_mappings
end

#pbm_uuidObject

Returns the value of attribute pbm_uuid.



13
14
15
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 13

def pbm_uuid
  @pbm_uuid
end

#policy_engine_modeObject

Returns the value of attribute policy_engine_mode.



37
38
39
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 37

def policy_engine_mode
  @policy_engine_mode
end

#providerObject

Returns the value of attribute provider.



15
16
17
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 15

def provider
  @provider
end

#refresh_token_validityObject

Maximum refresh token validity for registered clients (Format: hours=1;minutes=2;seconds=3).



32
33
34
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 32

def refresh_token_validity
  @refresh_token_validity
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



78
79
80
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 78

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



83
84
85
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 83

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 62

def self.attribute_map
  {
    :'pbm_uuid' => :'pbm_uuid',
    :'provider' => :'provider',
    :'default_application_group' => :'default_application_group',
    :'override_authorization_flow' => :'override_authorization_flow',
    :'override_invalidation_flow' => :'override_invalidation_flow',
    :'override_property_mappings' => :'override_property_mappings',
    :'access_token_validity' => :'access_token_validity',
    :'refresh_token_validity' => :'refresh_token_validity',
    :'allowed_grant_types' => :'allowed_grant_types',
    :'policy_engine_mode' => :'policy_engine_mode'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 253

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_nullableObject

List of attributes with nullable: true



104
105
106
107
108
109
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 104

def self.openapi_nullable
  Set.new([
    :'override_authorization_flow',
    :'override_invalidation_flow',
  ])
end

.openapi_typesObject

Attribute type mapping.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 88

def self.openapi_types
  {
    :'pbm_uuid' => :'String',
    :'provider' => :'Integer',
    :'default_application_group' => :'String',
    :'override_authorization_flow' => :'String',
    :'override_invalidation_flow' => :'String',
    :'override_property_mappings' => :'Array<String>',
    :'access_token_validity' => :'String',
    :'refresh_token_validity' => :'String',
    :'allowed_grant_types' => :'Array<GrantTypeEnum>',
    :'policy_engine_mode' => :'PolicyEngineMode'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 223

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      pbm_uuid == o.pbm_uuid &&
      provider == o.provider &&
      default_application_group == o.default_application_group &&
      override_authorization_flow == o.override_authorization_flow &&
      override_invalidation_flow == o.override_invalidation_flow &&
      override_property_mappings == o.override_property_mappings &&
      access_token_validity == o.access_token_validity &&
      refresh_token_validity == o.refresh_token_validity &&
      allowed_grant_types == o.allowed_grant_types &&
      policy_engine_mode == o.policy_engine_mode
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


240
241
242
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 240

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



246
247
248
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 246

def hash
  [pbm_uuid, provider, default_application_group, override_authorization_flow, override_invalidation_flow, override_property_mappings, access_token_validity, refresh_token_validity, allowed_grant_types, policy_engine_mode].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 178

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @pbm_uuid.nil?
    invalid_properties.push('invalid value for "pbm_uuid", pbm_uuid cannot be nil.')
  end

  if @provider.nil?
    invalid_properties.push('invalid value for "provider", provider cannot be nil.')
  end

  invalid_properties
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



275
276
277
278
279
280
281
282
283
284
285
286
287
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 275

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

Returns:

  • (Boolean)

    true if the model is valid



194
195
196
197
198
199
# File 'lib/authentik/api/models/o_auth2_dynamic_client_registration.rb', line 194

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @pbm_uuid.nil?
  return false if @provider.nil?
  true
end