Class: OCI::Vault::Models::SecretExpiryRule
- Inherits:
-
SecretRule
- Object
- SecretRule
- OCI::Vault::Models::SecretExpiryRule
- Defined in:
- lib/oci/vault/models/secret_expiry_rule.rb
Overview
A rule that helps enforce the expiration of a secret's contents.
Constant Summary
Constants inherited from SecretRule
OCI::Vault::Models::SecretRule::RULE_TYPE_ENUM
Instance Attribute Summary collapse
-
#is_secret_content_retrieval_blocked_on_expiry ⇒ BOOLEAN
A property indicating whether to block retrieval of the secret content, on expiry.
-
#secret_version_expiry_interval ⇒ String
A property indicating how long the secret contents will be considered valid, expressed in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#Time_intervals) format.
-
#time_of_absolute_expiry ⇒ DateTime
An optional property indicating the absolute time when this secret will expire, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format.
Attributes inherited from SecretRule
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 = {}) ⇒ SecretExpiryRule
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.
Methods inherited from SecretRule
Constructor Details
#initialize(attributes = {}) ⇒ SecretExpiryRule
Initializes the object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 68 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['ruleType'] = 'SECRET_EXPIRY_RULE' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.secret_version_expiry_interval = attributes[:'secretVersionExpiryInterval'] if attributes[:'secretVersionExpiryInterval'] raise 'You cannot provide both :secretVersionExpiryInterval and :secret_version_expiry_interval' if attributes.key?(:'secretVersionExpiryInterval') && attributes.key?(:'secret_version_expiry_interval') self.secret_version_expiry_interval = attributes[:'secret_version_expiry_interval'] if attributes[:'secret_version_expiry_interval'] self.time_of_absolute_expiry = attributes[:'timeOfAbsoluteExpiry'] if attributes[:'timeOfAbsoluteExpiry'] raise 'You cannot provide both :timeOfAbsoluteExpiry and :time_of_absolute_expiry' if attributes.key?(:'timeOfAbsoluteExpiry') && attributes.key?(:'time_of_absolute_expiry') self.time_of_absolute_expiry = attributes[:'time_of_absolute_expiry'] if attributes[:'time_of_absolute_expiry'] self.is_secret_content_retrieval_blocked_on_expiry = attributes[:'isSecretContentRetrievalBlockedOnExpiry'] unless attributes[:'isSecretContentRetrievalBlockedOnExpiry'].nil? raise 'You cannot provide both :isSecretContentRetrievalBlockedOnExpiry and :is_secret_content_retrieval_blocked_on_expiry' if attributes.key?(:'isSecretContentRetrievalBlockedOnExpiry') && attributes.key?(:'is_secret_content_retrieval_blocked_on_expiry') self.is_secret_content_retrieval_blocked_on_expiry = attributes[:'is_secret_content_retrieval_blocked_on_expiry'] unless attributes[:'is_secret_content_retrieval_blocked_on_expiry'].nil? end |
Instance Attribute Details
#is_secret_content_retrieval_blocked_on_expiry ⇒ BOOLEAN
A property indicating whether to block retrieval of the secret content, on expiry. The default is false. If the secret has already expired and you would like to retrieve the secret contents, you need to edit the secret rule to disable this property, to allow reading the secret content.
33 34 35 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 33 def is_secret_content_retrieval_blocked_on_expiry @is_secret_content_retrieval_blocked_on_expiry end |
#secret_version_expiry_interval ⇒ String
A property indicating how long the secret contents will be considered valid, expressed in [ISO 8601](en.wikipedia.org/wiki/ISO_8601#Time_intervals) format. The secret needs to be updated when the secret content expires. The timer resets after you update the secret contents. The minimum value is 1 day and the maximum value is 90 days for this property. Currently, only intervals expressed in days are supported. For example, pass `P3D` to have the secret version expire every 3 days.
19 20 21 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 19 def secret_version_expiry_interval @secret_version_expiry_interval end |
#time_of_absolute_expiry ⇒ DateTime
An optional property indicating the absolute time when this secret will expire, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format. The minimum number of days from current time is 1 day and the maximum number of days from current time is 365 days. Example: `2019-04-03T21:10:29.600Z`
26 27 28 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 26 def time_of_absolute_expiry @time_of_absolute_expiry end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 36 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'rule_type': :'ruleType', 'secret_version_expiry_interval': :'secretVersionExpiryInterval', 'time_of_absolute_expiry': :'timeOfAbsoluteExpiry', 'is_secret_content_retrieval_blocked_on_expiry': :'isSecretContentRetrievalBlockedOnExpiry' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
48 49 50 51 52 53 54 55 56 57 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 48 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'rule_type': :'String', 'secret_version_expiry_interval': :'String', 'time_of_absolute_expiry': :'DateTime', 'is_secret_content_retrieval_blocked_on_expiry': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
104 105 106 107 108 109 110 111 112 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 104 def ==(other) return true if equal?(other) self.class == other.class && rule_type == other.rule_type && secret_version_expiry_interval == other.secret_version_expiry_interval && time_of_absolute_expiry == other.time_of_absolute_expiry && is_secret_content_retrieval_blocked_on_expiry == other.is_secret_content_retrieval_blocked_on_expiry end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 137 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
117 118 119 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 117 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
126 127 128 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 126 def hash [rule_type, secret_version_expiry_interval, time_of_absolute_expiry, is_secret_content_retrieval_blocked_on_expiry].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
170 171 172 173 174 175 176 177 178 179 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 170 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
164 165 166 |
# File 'lib/oci/vault/models/secret_expiry_rule.rb', line 164 def to_s to_hash.to_s end |