Class: IbmCloudIam::TrustedProfile
- Inherits:
-
ApiModelBase
- Object
- ApiModelBase
- IbmCloudIam::TrustedProfile
- Defined in:
- lib/ibm_cloud_iam/models/trusted_profile.rb
Overview
Response body format for trusted profile V1 REST requests.
Instance Attribute Summary collapse
-
#account_id ⇒ Object
ID of the account that this trusted profile belong to.
-
#activity ⇒ Object
Returns the value of attribute activity.
-
#assignment_id ⇒ Object
ID of the assignment that was used to create an enterprise-managed trusted profile in your account.
-
#context ⇒ Object
Returns the value of attribute context.
-
#created_at ⇒ Object
If set contains a date time string of the creation date in ISO format.
-
#crn ⇒ Object
Cloud Resource Name of the item.
-
#description ⇒ Object
The optional description of the trusted profile.
-
#email ⇒ Object
The optional email of the trusted profile.
-
#entity_tag ⇒ Object
Version of the trusted profile details object.
-
#history ⇒ Object
History of the trusted profile.
-
#iam_id ⇒ Object
The iam_id of this trusted profile.
-
#id ⇒ Object
the unique identifier of the trusted profile.
-
#ims_account_id ⇒ Object
IMS acount ID of the trusted profile.
-
#ims_user_id ⇒ Object
IMS user ID of the trusted profile.
-
#modified_at ⇒ Object
If set contains a date time string of the last modification date in ISO format.
-
#name ⇒ Object
Name of the trusted profile.
-
#template_id ⇒ Object
ID of the IAM template that was used to create an enterprise-managed trusted profile in your account.
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 = {}) ⇒ TrustedProfile
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 = {}) ⇒ TrustedProfile
Initializes the object
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 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 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 132 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `IbmCloudIam::TrustedProfile` 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::TrustedProfile`. 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?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'entity_tag') self.entity_tag = attributes[:'entity_tag'] else self.entity_tag = nil end if attributes.key?(:'crn') self.crn = attributes[:'crn'] else self.crn = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'email') self.email = attributes[:'email'] end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'modified_at') self.modified_at = attributes[:'modified_at'] end if attributes.key?(:'iam_id') self.iam_id = attributes[:'iam_id'] else self.iam_id = nil end if attributes.key?(:'account_id') self.account_id = attributes[:'account_id'] else self.account_id = nil end if attributes.key?(:'template_id') self.template_id = attributes[:'template_id'] end if attributes.key?(:'assignment_id') self.assignment_id = attributes[:'assignment_id'] end if attributes.key?(:'ims_account_id') self.ims_account_id = attributes[:'ims_account_id'] end if attributes.key?(:'ims_user_id') self.ims_user_id = attributes[:'ims_user_id'] end if attributes.key?(:'history') if (value = attributes[:'history']).is_a?(Array) self.history = value end end if attributes.key?(:'activity') self.activity = attributes[:'activity'] end end |
Instance Attribute Details
#account_id ⇒ Object
ID of the account that this trusted profile belong to.
49 50 51 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 49 def account_id @account_id end |
#activity ⇒ Object
Returns the value of attribute activity.
66 67 68 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 66 def activity @activity end |
#assignment_id ⇒ Object
ID of the assignment that was used to create an enterprise-managed trusted profile in your account. When returned, this indicates that the trusted profile is created from and managed by a template in the root enterprise account.
55 56 57 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 55 def assignment_id @assignment_id end |
#context ⇒ Object
Returns the value of attribute context.
19 20 21 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 19 def context @context end |
#created_at ⇒ Object
If set contains a date time string of the creation date in ISO format.
40 41 42 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 40 def created_at @created_at end |
#crn ⇒ Object
Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::profile:Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'
28 29 30 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 28 def crn @crn end |
#description ⇒ Object
The optional description of the trusted profile. The 'description' property is only available if a description was provided during a create of a trusted profile.
34 35 36 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 34 def description @description end |
#email ⇒ Object
The optional email of the trusted profile. The 'email' property is only available if an email was provided during a create of a trusted profile.
37 38 39 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 37 def email @email end |
#entity_tag ⇒ Object
Version of the trusted profile details object. You need to specify this value when updating the trusted profile to avoid stale updates.
25 26 27 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 25 def entity_tag @entity_tag end |
#history ⇒ Object
History of the trusted profile.
64 65 66 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 64 def history @history end |
#iam_id ⇒ Object
The iam_id of this trusted profile.
46 47 48 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 46 def iam_id @iam_id end |
#id ⇒ Object
the unique identifier of the trusted profile. Example:'Profile-94497d0d-2ac3-41bf-a993-a49d1b14627c'
22 23 24 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 22 def id @id end |
#ims_account_id ⇒ Object
IMS acount ID of the trusted profile
58 59 60 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 58 def ims_account_id @ims_account_id end |
#ims_user_id ⇒ Object
IMS user ID of the trusted profile
61 62 63 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 61 def ims_user_id @ims_user_id end |
#modified_at ⇒ Object
If set contains a date time string of the last modification date in ISO format.
43 44 45 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 43 def modified_at @modified_at end |
#name ⇒ Object
Name of the trusted profile. The name is checked for uniqueness. Therefore trusted profiles with the same names can not exist in the same account.
31 32 33 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 31 def name @name end |
#template_id ⇒ Object
ID of the IAM template that was used to create an enterprise-managed trusted profile in your account. When returned, this indicates that the trusted profile is created from and managed by a template in the root enterprise account.
52 53 54 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 52 def template_id @template_id end |
Class Method Details
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about
92 93 94 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 92 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
97 98 99 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 97 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 69 def self.attribute_map { :'context' => :'context', :'id' => :'id', :'entity_tag' => :'entity_tag', :'crn' => :'crn', :'name' => :'name', :'description' => :'description', :'email' => :'email', :'created_at' => :'created_at', :'modified_at' => :'modified_at', :'iam_id' => :'iam_id', :'account_id' => :'account_id', :'template_id' => :'template_id', :'assignment_id' => :'assignment_id', :'ims_account_id' => :'ims_account_id', :'ims_user_id' => :'ims_user_id', :'history' => :'history', :'activity' => :'activity' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 373 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
125 126 127 128 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 125 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 102 def self.openapi_types { :'context' => :'ResponseContext', :'id' => :'String', :'entity_tag' => :'String', :'crn' => :'String', :'name' => :'String', :'description' => :'String', :'email' => :'String', :'created_at' => :'Time', :'modified_at' => :'Time', :'iam_id' => :'String', :'account_id' => :'String', :'template_id' => :'String', :'assignment_id' => :'String', :'ims_account_id' => :'Integer', :'ims_user_id' => :'Integer', :'history' => :'Array<EnityHistoryRecord>', :'activity' => :'Activity' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 336 def ==(o) return true if self.equal?(o) self.class == o.class && context == o.context && id == o.id && entity_tag == o.entity_tag && crn == o.crn && name == o.name && description == o.description && email == o.email && created_at == o.created_at && modified_at == o.modified_at && iam_id == o.iam_id && account_id == o.account_id && template_id == o.template_id && assignment_id == o.assignment_id && ims_account_id == o.ims_account_id && ims_user_id == o.ims_user_id && history == o.history && activity == o.activity end |
#eql?(o) ⇒ Boolean
360 361 362 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 360 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
366 367 368 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 366 def hash [context, id, entity_tag, crn, name, description, email, created_at, modified_at, iam_id, account_id, template_id, assignment_id, ims_account_id, ims_user_id, history, activity].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 231 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @entity_tag.nil? invalid_properties.push('invalid value for "entity_tag", entity_tag cannot be nil.') end if @crn.nil? invalid_properties.push('invalid value for "crn", crn cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @iam_id.nil? invalid_properties.push('invalid value for "iam_id", iam_id cannot be nil.') end if @account_id.nil? invalid_properties.push('invalid value for "account_id", account_id cannot be nil.') end invalid_properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
395 396 397 398 399 400 401 402 403 404 405 406 407 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 395 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
263 264 265 266 267 268 269 270 271 272 |
# File 'lib/ibm_cloud_iam/models/trusted_profile.rb', line 263 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @entity_tag.nil? return false if @crn.nil? return false if @name.nil? return false if @iam_id.nil? return false if @account_id.nil? true end |