Class: IntersightClient::IamAppRegistrationAllOf
- Inherits:
-
Object
- Object
- IntersightClient::IamAppRegistrationAllOf
- Defined in:
- lib/intersight_client/models/iam_app_registration_all_of.rb
Overview
Definition of the list of properties defined in ‘iam.AppRegistration’, excluding properties defined in parent classes.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#client_id ⇒ Object
A unique identifier for the OAuth2 client application.
-
#client_name ⇒ Object
App Registration name specified by user.
-
#client_secret ⇒ Object
The OAuth2 client secret.
-
#client_type ⇒ Object
The type of the OAuth2 client (public or confidential), as specified in tools.ietf.org/html/rfc6749#section-2.1.
-
#description ⇒ Object
Description of the application.
-
#grant_types ⇒ Object
Returns the value of attribute grant_types.
-
#oauth_tokens ⇒ Object
An array of relationships to iamOAuthToken resources.
-
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type.
-
#permission ⇒ Object
Returns the value of attribute permission.
-
#redirect_uris ⇒ Object
Returns the value of attribute redirect_uris.
-
#renew_client_secret ⇒ Object
Set value to true to renew the client-secret.
-
#response_types ⇒ Object
Returns the value of attribute response_types.
-
#revocation_timestamp ⇒ Object
Used to perform revocation for tokens of AppRegistration.
-
#revoke ⇒ Object
Used to trigger update the revocationTimestamp value.
-
#roles ⇒ Object
An array of relationships to iamRole resources.
-
#user ⇒ Object
Returns the value of attribute user.
Class Method Summary collapse
-
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes 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.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ IamAppRegistrationAllOf
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ IamAppRegistrationAllOf
Initializes the object
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 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 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 160 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IntersightClient::IamAppRegistrationAllOf` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.acceptable_attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `#{self.class.name}`. Please check the name to make sure it's valid. List of attributes: " + self.class.acceptable_attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'class_id') self.class_id = attributes[:'class_id'] else self.class_id = 'iam.AppRegistration' end if attributes.key?(:'object_type') self.object_type = attributes[:'object_type'] else self.object_type = 'iam.AppRegistration' end if attributes.key?(:'client_id') self.client_id = attributes[:'client_id'] end if attributes.key?(:'client_name') self.client_name = attributes[:'client_name'] end if attributes.key?(:'client_secret') self.client_secret = attributes[:'client_secret'] end if attributes.key?(:'client_type') self.client_type = attributes[:'client_type'] else self.client_type = 'public' end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'grant_types') if (value = attributes[:'grant_types']).is_a?(Array) self.grant_types = value end end if attributes.key?(:'redirect_uris') if (value = attributes[:'redirect_uris']).is_a?(Array) self.redirect_uris = value end end if attributes.key?(:'renew_client_secret') self.renew_client_secret = attributes[:'renew_client_secret'] else self.renew_client_secret = false end if attributes.key?(:'response_types') if (value = attributes[:'response_types']).is_a?(Array) self.response_types = value end end if attributes.key?(:'revocation_timestamp') self. = attributes[:'revocation_timestamp'] end if attributes.key?(:'revoke') self.revoke = attributes[:'revoke'] else self.revoke = false end if attributes.key?(:'account') self.account = attributes[:'account'] end if attributes.key?(:'oauth_tokens') if (value = attributes[:'oauth_tokens']).is_a?(Array) self.oauth_tokens = value end end if attributes.key?(:'permission') self. = attributes[:'permission'] end if attributes.key?(:'roles') if (value = attributes[:'roles']).is_a?(Array) self.roles = value end end if attributes.key?(:'user') self.user = attributes[:'user'] end end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
55 56 57 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 55 def account @account end |
#class_id ⇒ Object
The fully-qualified name of the instantiated, concrete type. This property is used as a discriminator to identify the type of the payload when marshaling and unmarshaling data.
20 21 22 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 20 def class_id @class_id end |
#client_id ⇒ Object
A unique identifier for the OAuth2 client application. The client ID is auto-generated when the AppRegistration object is created.
26 27 28 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 26 def client_id @client_id end |
#client_name ⇒ Object
App Registration name specified by user.
29 30 31 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 29 def client_name @client_name end |
#client_secret ⇒ Object
The OAuth2 client secret. The value of this property is generated when grantType includes ‘client-credentials’. Otherwise, no client-secret is generated.
32 33 34 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 32 def client_secret @client_secret end |
#client_type ⇒ Object
The type of the OAuth2 client (public or confidential), as specified in tools.ietf.org/html/rfc6749#section-2.1. * public - Clients incapable of maintaining the confidentiality of their credentials.This includes clients executing on the device used by the resource owner,such as mobile applications, installed native application or a webbrowser-based application. * confidential - Clients capable of maintaining the confidentiality of their credentials.For example, this could be a client implemented on a secure server withrestricted access to the client credentials.To maintain the confidentiality of the OAuth2 credentials, two use cases areconsidered.1) The application is running as a service within Intersight. The application automatically obtains the OAuth2 credentials when the application starts and the credentials are not exposed to the end-user. Because end-users (even account administrators) do not have access the OAuth2 credentials, they cannot take the credentials with them when they leave their organization.2) The application is under the control of a "trusted" end-user. For example, the end-user may create a native application running outside Intersight. The application uses OAuth2 credentials to interact with the Intersight API. In that case, the Intersight account administrator may generate OAuth2 credentials with a registered application using "client_credentials" grant type. In that case, the end-user is responsible for maintaining the confidentiality of the OAuth2 credentials. If the end-user leaves the organization, you should revoke the credentials and issue new Oauth2 credentials.Here is a possible workflow for handling OAuth2 tokens.1) User Alice (Intersight Account Administrator) logins to Intersight and deploys an Intersight application that requires an OAuth2 token.2) Intersight automatically deploys the application. The application is assigned a OAuth2 token, possibly linked to Alice. The application must NOT expose the OAuth2 secret to Alice, otherwise Alice would be able to use the token after she leaves the company.3) The application can make API calls to Intersight using its assigned OAuth2 token. For example, the application could make weekly scheduled API calls to Intersight.4) Separately, Alice may also get OAuth2 tokens that she can use to make API calls from the Intersight SDK through the northbound API. In that case, Alice will get the associated OAuth2 secrets, but not the one assigned in step #2.5) Alice leaves the organization. The OAuth2 tokens assigned in step #2 must retain their validity even after Alice has left the organization. Because the OAuth2 secrets were never shared with Alice, there is no risk Alice can reuse the OAuth2 secrets. On the other hand, the OAuth2 tokens assigned in step #4 must be invalidated because Alice had the OAuth2 tokens in her possession.
35 36 37 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 35 def client_type @client_type end |
#description ⇒ Object
Description of the application.
38 39 40 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 38 def description @description end |
#grant_types ⇒ Object
Returns the value of attribute grant_types.
40 41 42 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 40 def grant_types @grant_types end |
#oauth_tokens ⇒ Object
An array of relationships to iamOAuthToken resources.
58 59 60 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 58 def oauth_tokens @oauth_tokens end |
#object_type ⇒ Object
The fully-qualified name of the instantiated, concrete type. The value should be the same as the ‘ClassId’ property.
23 24 25 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 23 def object_type @object_type end |
#permission ⇒ Object
Returns the value of attribute permission.
60 61 62 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 60 def end |
#redirect_uris ⇒ Object
Returns the value of attribute redirect_uris.
42 43 44 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 42 def redirect_uris @redirect_uris end |
#renew_client_secret ⇒ Object
Set value to true to renew the client-secret. Applicable to client_credentials grant type.
45 46 47 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 45 def renew_client_secret @renew_client_secret end |
#response_types ⇒ Object
Returns the value of attribute response_types.
47 48 49 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 47 def response_types @response_types end |
#revocation_timestamp ⇒ Object
Used to perform revocation for tokens of AppRegistration. Updated only internally is case Revoke property come from UI with value true. On each request with OAuth2 access token the CreationTime of the OAuth2 token will be compared to RevokationTimestamp of the corresponding App Registration.
50 51 52 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 50 def end |
#revoke ⇒ Object
Used to trigger update the revocationTimestamp value. If UI sent updating request with the Revoke value is true, then update RevocationTimestamp.
53 54 55 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 53 def revoke @revoke end |
#roles ⇒ Object
An array of relationships to iamRole resources.
63 64 65 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 63 def roles @roles end |
#user ⇒ Object
Returns the value of attribute user.
65 66 67 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 65 def user @user end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns the key-value map of all the JSON attributes this model knows about
119 120 121 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 119 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
114 115 116 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 114 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 90 def self.attribute_map { :'class_id' => :'ClassId', :'object_type' => :'ObjectType', :'client_id' => :'ClientId', :'client_name' => :'ClientName', :'client_secret' => :'ClientSecret', :'client_type' => :'ClientType', :'description' => :'Description', :'grant_types' => :'GrantTypes', :'redirect_uris' => :'RedirectUris', :'renew_client_secret' => :'RenewClientSecret', :'response_types' => :'ResponseTypes', :'revocation_timestamp' => :'RevocationTimestamp', :'revoke' => :'Revoke', :'account' => :'Account', :'oauth_tokens' => :'OauthTokens', :'permission' => :'Permission', :'roles' => :'Roles', :'user' => :'User' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
365 366 367 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 365 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
148 149 150 151 152 153 154 155 156 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 148 def self.openapi_nullable Set.new([ :'grant_types', :'redirect_uris', :'response_types', :'oauth_tokens', :'roles', ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 124 def self.openapi_types { :'class_id' => :'String', :'object_type' => :'String', :'client_id' => :'String', :'client_name' => :'String', :'client_secret' => :'String', :'client_type' => :'String', :'description' => :'String', :'grant_types' => :'Array<String>', :'redirect_uris' => :'Array<String>', :'renew_client_secret' => :'Boolean', :'response_types' => :'Array<String>', :'revocation_timestamp' => :'Time', :'revoke' => :'Boolean', :'account' => :'IamAccountRelationship', :'oauth_tokens' => :'Array<IamOAuthTokenRelationship>', :'permission' => :'IamPermissionRelationship', :'roles' => :'Array<IamRoleRelationship>', :'user' => :'IamUserRelationship' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 327 def ==(o) return true if self.equal?(o) self.class == o.class && class_id == o.class_id && object_type == o.object_type && client_id == o.client_id && client_name == o.client_name && client_secret == o.client_secret && client_type == o.client_type && description == o.description && grant_types == o.grant_types && redirect_uris == o.redirect_uris && renew_client_secret == o.renew_client_secret && response_types == o.response_types && == o. && revoke == o.revoke && account == o.account && oauth_tokens == o.oauth_tokens && == o. && roles == o.roles && user == o.user end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 395 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = IntersightClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
466 467 468 469 470 471 472 473 474 475 476 477 478 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 466 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 372 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) IamAppRegistrationAllOf.openapi_types.each_pair do |key, type| if attributes[IamAppRegistrationAllOf.attribute_map[key]].nil? && IamAppRegistrationAllOf.openapi_nullable.include?(key) self.send("#{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[IamAppRegistrationAllOf.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[IamAppRegistrationAllOf.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[IamAppRegistrationAllOf.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[IamAppRegistrationAllOf.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
352 353 354 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 352 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
358 359 360 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 358 def hash [class_id, object_type, client_id, client_name, client_secret, client_type, description, grant_types, redirect_uris, renew_client_secret, response_types, , revoke, account, oauth_tokens, , roles, user].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 268 def list_invalid_properties invalid_properties = Array.new if @class_id.nil? invalid_properties.push('invalid value for "class_id", class_id cannot be nil.') end if @object_type.nil? invalid_properties.push('invalid value for "object_type", object_type cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
442 443 444 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 442 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
448 449 450 451 452 453 454 455 456 457 458 459 460 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 448 def to_hash hash = {} IamAppRegistrationAllOf.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = IamAppRegistrationAllOf.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
436 437 438 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 436 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/intersight_client/models/iam_app_registration_all_of.rb', line 283 def valid? return false if @class_id.nil? class_id_validator = EnumAttributeValidator.new('String', ["iam.AppRegistration"]) return false unless class_id_validator.valid?(@class_id) return false if @object_type.nil? object_type_validator = EnumAttributeValidator.new('String', ["iam.AppRegistration"]) return false unless object_type_validator.valid?(@object_type) client_type_validator = EnumAttributeValidator.new('String', ["public", "confidential"]) return false unless client_type_validator.valid?(@client_type) true end |