Class: IbmCloudIam::AccountSettingsResponse

Inherits:
ApiModelBase show all
Defined in:
lib/ibm_cloud_iam/models/account_settings_response.rb

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 = {}) ⇒ AccountSettingsResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
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/ibm_cloud_iam/models/account_settings_response.rb', line 153

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

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

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

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

  if attributes.key?(:'restrict_create_service_id')
    self.restrict_create_service_id = attributes[:'restrict_create_service_id']
  else
    self.restrict_create_service_id = 'NOT_SET'
  end

  if attributes.key?(:'restrict_create_platform_apikey')
    self.restrict_create_platform_apikey = attributes[:'restrict_create_platform_apikey']
  else
    self.restrict_create_platform_apikey = 'NOT_SET'
  end

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

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

  if attributes.key?(:'session_expiration_in_seconds')
    self.session_expiration_in_seconds = attributes[:'session_expiration_in_seconds']
  else
    self.session_expiration_in_seconds = '86400'
  end

  if attributes.key?(:'session_invalidation_in_seconds')
    self.session_invalidation_in_seconds = attributes[:'session_invalidation_in_seconds']
  else
    self.session_invalidation_in_seconds = '7200'
  end

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

  if attributes.key?(:'system_access_token_expiration_in_seconds')
    self.system_access_token_expiration_in_seconds = attributes[:'system_access_token_expiration_in_seconds']
  else
    self.system_access_token_expiration_in_seconds = '3600'
  end

  if attributes.key?(:'system_refresh_token_expiration_in_seconds')
    self.system_refresh_token_expiration_in_seconds = attributes[:'system_refresh_token_expiration_in_seconds']
  else
    self.system_refresh_token_expiration_in_seconds = '259200'
  end

  if attributes.key?(:'restrict_user_list_visibility')
    self.restrict_user_list_visibility = attributes[:'restrict_user_list_visibility']
  else
    self.restrict_user_list_visibility = 'NOT_RESTRICTED'
  end

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

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

Instance Attribute Details

#account_idObject

Unique ID of the account.



21
22
23
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 21

def 
  @account_id
end

#allowed_ip_addressesObject

Defines the IP addresses and subnets from which IAM tokens can be created for the account.



34
35
36
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 34

def allowed_ip_addresses
  @allowed_ip_addresses
end

#contextObject

Returns the value of attribute context.



18
19
20
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 18

def context
  @context
end

#entity_tagObject

Version of the account settings.



24
25
26
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 24

def entity_tag
  @entity_tag
end

#historyObject

History of the Account Settings.



27
28
29
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 27

def history
  @history
end

#max_sessions_per_identityObject

Defines the max allowed sessions per identity required by the account. Valid values: * Any whole number greater than 0 * NOT_SET - To unset account setting and use service default



45
46
47
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 45

def max_sessions_per_identity
  @max_sessions_per_identity
end

#mfaObject

Returns the value of attribute mfa.



36
37
38
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 36

def mfa
  @mfa
end

#restrict_create_platform_apikeyObject

Returns the value of attribute restrict_create_platform_apikey.



31
32
33
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 31

def restrict_create_platform_apikey
  @restrict_create_platform_apikey
end

#restrict_create_service_idObject

Returns the value of attribute restrict_create_service_id.



29
30
31
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 29

def restrict_create_service_id
  @restrict_create_service_id
end

#restrict_user_domainsObject

Defines if account invitations are restricted to specified domains. To remove an entry for a realm_id, perform an update (PUT) request with only the realm_id set.



59
60
61
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 59

def restrict_user_domains
  @restrict_user_domains
end

#restrict_user_list_visibilityObject

Returns the value of attribute restrict_user_list_visibility.



53
54
55
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 53

def restrict_user_list_visibility
  @restrict_user_list_visibility
end

#session_expiration_in_secondsObject

Defines the session expiration in seconds for the account. Valid values: * Any whole number between between '900' and '86400' * NOT_SET - To unset account setting and use service default



39
40
41
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 39

def session_expiration_in_seconds
  @session_expiration_in_seconds
end

#session_invalidation_in_secondsObject

Defines the period of time in seconds in which a session will be invalidated due to inactivity. Valid values: * Any whole number between '900' and '7200' * NOT_SET - To unset account setting and use service default



42
43
44
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 42

def session_invalidation_in_seconds
  @session_invalidation_in_seconds
end

#system_access_token_expiration_in_secondsObject

Defines the access token expiration in seconds. Valid values: * Any whole number between '900' and '3600' * NOT_SET - To unset account setting and use service default



48
49
50
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 48

def system_access_token_expiration_in_seconds
  @system_access_token_expiration_in_seconds
end

#system_refresh_token_expiration_in_secondsObject

Defines the refresh token expiration in seconds. Valid values: * Any whole number between '900' and '259200' * NOT_SET - To unset account setting and use service default



51
52
53
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 51

def system_refresh_token_expiration_in_seconds
  @system_refresh_token_expiration_in_seconds
end

#user_mfaObject

List of users that are exempted from the MFA requirement of the account.



56
57
58
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 56

def user_mfa
  @user_mfa
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



106
107
108
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 106

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



111
112
113
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 111

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 84

def self.attribute_map
  {
    :'context' => :'context',
    :'account_id' => :'account_id',
    :'entity_tag' => :'entity_tag',
    :'history' => :'history',
    :'restrict_create_service_id' => :'restrict_create_service_id',
    :'restrict_create_platform_apikey' => :'restrict_create_platform_apikey',
    :'allowed_ip_addresses' => :'allowed_ip_addresses',
    :'mfa' => :'mfa',
    :'session_expiration_in_seconds' => :'session_expiration_in_seconds',
    :'session_invalidation_in_seconds' => :'session_invalidation_in_seconds',
    :'max_sessions_per_identity' => :'max_sessions_per_identity',
    :'system_access_token_expiration_in_seconds' => :'system_access_token_expiration_in_seconds',
    :'system_refresh_token_expiration_in_seconds' => :'system_refresh_token_expiration_in_seconds',
    :'restrict_user_list_visibility' => :'restrict_user_list_visibility',
    :'user_mfa' => :'user_mfa',
    :'restrict_user_domains' => :'restrict_user_domains'
  }
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



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 529

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_all_ofObject

List of class defined in allOf (OpenAPI v3)



144
145
146
147
148
149
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 144

def self.openapi_all_of
  [
  :'AccountSettingsMeta',
  :'CommonAccountSettingsResponse'
  ]
end

.openapi_nullableObject

List of attributes with nullable: true



138
139
140
141
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 138

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 116

def self.openapi_types
  {
    :'context' => :'ResponseContext',
    :'account_id' => :'String',
    :'entity_tag' => :'String',
    :'history' => :'Array<EnityHistoryRecord>',
    :'restrict_create_service_id' => :'RetrictActions',
    :'restrict_create_platform_apikey' => :'RetrictActions',
    :'allowed_ip_addresses' => :'String',
    :'mfa' => :'MfaOptions',
    :'session_expiration_in_seconds' => :'String',
    :'session_invalidation_in_seconds' => :'String',
    :'max_sessions_per_identity' => :'String',
    :'system_access_token_expiration_in_seconds' => :'String',
    :'system_refresh_token_expiration_in_seconds' => :'String',
    :'restrict_user_list_visibility' => :'UserVisbilityRetrictActions',
    :'user_mfa' => :'Array<AccountSettingsUserMFAResponse>',
    :'restrict_user_domains' => :'Array<AccountSettingsUserDomainRestriction>'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 493

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      context == o.context &&
       == o. &&
      entity_tag == o.entity_tag &&
      history == o.history &&
      restrict_create_service_id == o.restrict_create_service_id &&
      restrict_create_platform_apikey == o.restrict_create_platform_apikey &&
      allowed_ip_addresses == o.allowed_ip_addresses &&
      mfa == o.mfa &&
      session_expiration_in_seconds == o.session_expiration_in_seconds &&
      session_invalidation_in_seconds == o.session_invalidation_in_seconds &&
      max_sessions_per_identity == o.max_sessions_per_identity &&
      system_access_token_expiration_in_seconds == o.system_access_token_expiration_in_seconds &&
      system_refresh_token_expiration_in_seconds == o.system_refresh_token_expiration_in_seconds &&
      restrict_user_list_visibility == o.restrict_user_list_visibility &&
      user_mfa == o.user_mfa &&
      restrict_user_domains == o.restrict_user_domains
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


516
517
518
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 516

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



522
523
524
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 522

def hash
  [context, , entity_tag, history, restrict_create_service_id, restrict_create_platform_apikey, allowed_ip_addresses, mfa, session_expiration_in_seconds, session_invalidation_in_seconds, max_sessions_per_identity, system_access_token_expiration_in_seconds, system_refresh_token_expiration_in_seconds, restrict_user_list_visibility, user_mfa, restrict_user_domains].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 268

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

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

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

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

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

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

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

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

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

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

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

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

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

  if @restrict_user_domains.nil?
    invalid_properties.push('invalid value for "restrict_user_domains", restrict_user_domains 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



551
552
553
554
555
556
557
558
559
560
561
562
563
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 551

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



332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/ibm_cloud_iam/models/account_settings_response.rb', line 332

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @account_id.nil?
  return false if @entity_tag.nil?
  return false if @restrict_create_service_id.nil?
  return false if @restrict_create_platform_apikey.nil?
  return false if @allowed_ip_addresses.nil?
  return false if @mfa.nil?
  return false if @session_expiration_in_seconds.nil?
  return false if @session_invalidation_in_seconds.nil?
  return false if @max_sessions_per_identity.nil?
  return false if @system_access_token_expiration_in_seconds.nil?
  return false if @system_refresh_token_expiration_in_seconds.nil?
  return false if @restrict_user_list_visibility.nil?
  return false if @user_mfa.nil?
  return false if @restrict_user_domains.nil?
  true
end