Class: IbmCloudIam::SamlMetadataImportResponse

Inherits:
ApiModelBase
  • Object
show all
Defined in:
lib/ibm_cloud_iam/models/saml_metadata_import_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 = {}) ⇒ SamlMetadataImportResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash



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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 134

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

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

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

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

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

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

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

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

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

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

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

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

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

Instance Attribute Details

#account_idObject

Account that owns the Identity Provider.



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

def 
  @account_id
end

#activeObject

Indicates whether the Identity Provider is enabled. If disabled, the IdP cannot be used by the owner account or any consumer accounts.



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

def active
  @active
end

#created_atObject

Creation timestamp.



25
26
27
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 25

def created_at
  @created_at
end

#entity_tagObject

Version information used for optimistic locking.



22
23
24
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 22

def entity_tag
  @entity_tag
end

#historyObject

History entries for the Identity Provider.



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

def history
  @history
end

#idp_idObject

Realm ID of the Identity Provider.



19
20
21
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 19

def idp_id
  @idp_id
end

#modified_atObject

Last modification timestamp.



28
29
30
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 28

def modified_at
  @modified_at
end

#nameObject

User-friendly name of the Identity Provider.



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

def name
  @name
end

#propertiesObject

Type-specific Identity Provider configuration.



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

def properties
  @properties
end

#secretsObject

Type-specific secret configuration.



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

def secrets
  @secrets
end

#share_scopeObject

Accounts, enterprises, or account groups allowed to consume the IdP.



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

def share_scope
  @share_scope
end

#typeObject

Returns the value of attribute type.



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

def type
  @type
end

#ui_setup_completedObject

Internal flag used by the UI to determine whether the Identity Provider should be opened in the setup wizard or the edit dialog.



54
55
56
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 54

def ui_setup_completed
  @ui_setup_completed
end

Class Method Details

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



98
99
100
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 98

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



103
104
105
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 103

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

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



79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 79

def self.attribute_map
  {
    :'idp_id' => :'idp_id',
    :'entity_tag' => :'entity_tag',
    :'created_at' => :'created_at',
    :'modified_at' => :'modified_at',
    :'account_id' => :'account_id',
    :'name' => :'name',
    :'type' => :'type',
    :'properties' => :'properties',
    :'secrets' => :'secrets',
    :'history' => :'history',
    :'share_scope' => :'share_scope',
    :'active' => :'active',
    :'ui_setup_completed' => :'ui_setup_completed'
  }
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



456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 456

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



127
128
129
130
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 127

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

.openapi_typesObject

Attribute type mapping.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 108

def self.openapi_types
  {
    :'idp_id' => :'String',
    :'entity_tag' => :'String',
    :'created_at' => :'Time',
    :'modified_at' => :'Time',
    :'account_id' => :'String',
    :'name' => :'String',
    :'type' => :'String',
    :'properties' => :'Object',
    :'secrets' => :'Object',
    :'history' => :'Array<Object>',
    :'share_scope' => :'Array<ShareScope>',
    :'active' => :'Boolean',
    :'ui_setup_completed' => :'Boolean'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 423

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      idp_id == o.idp_id &&
      entity_tag == o.entity_tag &&
      created_at == o.created_at &&
      modified_at == o.modified_at &&
       == o. &&
      name == o.name &&
      type == o.type &&
      properties == o.properties &&
      secrets == o.secrets &&
      history == o.history &&
      share_scope == o.share_scope &&
      active == o.active &&
      ui_setup_completed == o.ui_setup_completed
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


443
444
445
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 443

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



449
450
451
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 449

def hash
  [idp_id, entity_tag, created_at, modified_at, , name, type, properties, secrets, history, share_scope, active, ui_setup_completed].hash
end

#list_invalid_propertiesObject

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

Returns:

  • Array for valid properties with the reasons



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
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 227

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

  if @idp_id.to_s.length > 10
    invalid_properties.push('invalid value for "idp_id", the character length must be smaller than or equal to 10.')
  end

  if @idp_id.to_s.length < 3
    invalid_properties.push('invalid value for "idp_id", the character length must be greater than or equal to 3.')
  end

  pattern = Regexp.new(/^[A-Za-z0-9]+$/)
  if @idp_id !~ pattern
    invalid_properties.push("invalid value for \"idp_id\", must conform to the pattern #{pattern}.")
  end

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

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

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

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

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

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

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

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

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



478
479
480
481
482
483
484
485
486
487
488
489
490
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 478

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



288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/ibm_cloud_iam/models/saml_metadata_import_response.rb', line 288

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @idp_id.nil?
  return false if @idp_id.to_s.length > 10
  return false if @idp_id.to_s.length < 3
  return false if @idp_id !~ Regexp.new(/^[A-Za-z0-9]+$/)
  return false if @entity_tag.nil?
  return false if @created_at.nil?
  return false if @modified_at.nil?
  return false if @account_id.nil?
  return false if @name.nil?
  return false if @type.nil?
  type_validator = EnumAttributeValidator.new('String', ["saml"])
  return false unless type_validator.valid?(@type)
  return false if @properties.nil?
  return false if @secrets.nil?
  return false if @active.nil?
  true
end