Class: OCI::Bds::Models::BdsApiKey
- Inherits:
-
Object
- Object
- OCI::Bds::Models::BdsApiKey
- Defined in:
- lib/oci/bds/models/bds_api_key.rb
Overview
The API key information.
Constant Summary collapse
- LIFECYCLE_STATE_ENUM =
[ LIFECYCLE_STATE_CREATING = 'CREATING'.freeze, LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze, LIFECYCLE_STATE_DELETING = 'DELETING'.freeze, LIFECYCLE_STATE_DELETED = 'DELETED'.freeze, LIFECYCLE_STATE_FAILED = 'FAILED'.freeze, LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#default_region ⇒ String
[Required] The name of the region to establish the Object Storage endpoint.
-
#fingerprint ⇒ String
[Required] The fingerprint that corresponds to the public API key requested.
-
#id ⇒ String
[Required] Identifier of the user's API key.
-
#key_alias ⇒ String
[Required] User friendly identifier used to uniquely differentiate between different API keys.
-
#lifecycle_state ⇒ String
[Required] The state of the key.
-
#pemfilepath ⇒ String
[Required] The full path and file name of the private key used for authentication.
-
#tenant_id ⇒ String
[Required] The OCID of your tenancy.
-
#time_created ⇒ DateTime
The time the API key was created, shown as an RFC 3339 formatted datetime string.
-
#user_id ⇒ String
[Required] The user OCID for which this API key was created.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ BdsApiKey
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ BdsApiKey
Initializes the object
110 111 112 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 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 110 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.id = attributes[:'id'] if attributes[:'id'] self.user_id = attributes[:'userId'] if attributes[:'userId'] raise 'You cannot provide both :userId and :user_id' if attributes.key?(:'userId') && attributes.key?(:'user_id') self.user_id = attributes[:'user_id'] if attributes[:'user_id'] self.key_alias = attributes[:'keyAlias'] if attributes[:'keyAlias'] raise 'You cannot provide both :keyAlias and :key_alias' if attributes.key?(:'keyAlias') && attributes.key?(:'key_alias') self.key_alias = attributes[:'key_alias'] if attributes[:'key_alias'] self.default_region = attributes[:'defaultRegion'] if attributes[:'defaultRegion'] raise 'You cannot provide both :defaultRegion and :default_region' if attributes.key?(:'defaultRegion') && attributes.key?(:'default_region') self.default_region = attributes[:'default_region'] if attributes[:'default_region'] self.tenant_id = attributes[:'tenantId'] if attributes[:'tenantId'] raise 'You cannot provide both :tenantId and :tenant_id' if attributes.key?(:'tenantId') && attributes.key?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] if attributes[:'tenant_id'] self.fingerprint = attributes[:'fingerprint'] if attributes[:'fingerprint'] self.pemfilepath = attributes[:'pemfilepath'] if attributes[:'pemfilepath'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState'] raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state') self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state'] end |
Instance Attribute Details
#default_region ⇒ String
[Required] The name of the region to establish the Object Storage endpoint. Example us-phoenix-1 .
37 38 39 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 37 def default_region @default_region end |
#fingerprint ⇒ String
[Required] The fingerprint that corresponds to the public API key requested.
45 46 47 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 45 def fingerprint @fingerprint end |
#id ⇒ String
[Required] Identifier of the user's API key.
23 24 25 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 23 def id @id end |
#key_alias ⇒ String
[Required] User friendly identifier used to uniquely differentiate between different API keys. Only ASCII alphanumeric characters with no spaces allowed.
33 34 35 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 33 def key_alias @key_alias end |
#lifecycle_state ⇒ String
[Required] The state of the key.
59 60 61 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 59 def lifecycle_state @lifecycle_state end |
#pemfilepath ⇒ String
[Required] The full path and file name of the private key used for authentication. This location will be automatically selected on the BDS local file system.
51 52 53 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 51 def pemfilepath @pemfilepath end |
#tenant_id ⇒ String
[Required] The OCID of your tenancy.
41 42 43 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 41 def tenant_id @tenant_id end |
#time_created ⇒ DateTime
The time the API key was created, shown as an RFC 3339 formatted datetime string.
55 56 57 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 55 def time_created @time_created end |
#user_id ⇒ String
[Required] The user OCID for which this API key was created.
27 28 29 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 27 def user_id @user_id end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 62 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'id': :'id', 'user_id': :'userId', 'key_alias': :'keyAlias', 'default_region': :'defaultRegion', 'tenant_id': :'tenantId', 'fingerprint': :'fingerprint', 'pemfilepath': :'pemfilepath', 'time_created': :'timeCreated', 'lifecycle_state': :'lifecycleState' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 79 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'id': :'String', 'user_id': :'String', 'key_alias': :'String', 'default_region': :'String', 'tenant_id': :'String', 'fingerprint': :'String', 'pemfilepath': :'String', 'time_created': :'DateTime', 'lifecycle_state': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
179 180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 179 def ==(other) return true if equal?(other) self.class == other.class && id == other.id && user_id == other.user_id && key_alias == other.key_alias && default_region == other.default_region && tenant_id == other.tenant_id && fingerprint == other.fingerprint && pemfilepath == other.pemfilepath && time_created == other.time_created && lifecycle_state == other.lifecycle_state end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 217 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
197 198 199 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 197 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
206 207 208 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 206 def hash [id, user_id, key_alias, default_region, tenant_id, fingerprint, pemfilepath, time_created, lifecycle_state].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
250 251 252 253 254 255 256 257 258 259 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 250 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
244 245 246 |
# File 'lib/oci/bds/models/bds_api_key.rb', line 244 def to_s to_hash.to_s end |