Class: OCI::DataSafe::Models::AssociatedResourceSummary
- Inherits:
-
Object
- Object
- OCI::DataSafe::Models::AssociatedResourceSummary
- Defined in:
- lib/oci/data_safe/models/associated_resource_summary.rb
Overview
Summary details of the associated resource of an attribute set.
Constant Summary collapse
- ASSOCIATED_RESOURCE_TYPE_ENUM =
[ ASSOCIATED_RESOURCE_TYPE_AUDIT_POLICY = 'AUDIT_POLICY'.freeze, ASSOCIATED_RESOURCE_TYPE_AUDIT_REPORT = 'AUDIT_REPORT'.freeze, ASSOCIATED_RESOURCE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#associated_resource_id ⇒ String
The OCID of the resource that is associated with the attribute set.
-
#associated_resource_name ⇒ String
The display name of the resource that is associated with the attribute set.
-
#associated_resource_type ⇒ String
The resource type that is associated with the attribute set.
-
#time_created ⇒ DateTime
The date and time when associated started between resource and the attribute set, in the format defined by RFC3339.
-
#time_updated ⇒ DateTime
The date and time when associated is removed between resources and the attribute set, in the format defined by RFC3339.
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 = {}) ⇒ AssociatedResourceSummary
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 = {}) ⇒ AssociatedResourceSummary
Initializes the object
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 75 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.associated_resource_type = attributes[:'associatedResourceType'] if attributes[:'associatedResourceType'] raise 'You cannot provide both :associatedResourceType and :associated_resource_type' if attributes.key?(:'associatedResourceType') && attributes.key?(:'associated_resource_type') self.associated_resource_type = attributes[:'associated_resource_type'] if attributes[:'associated_resource_type'] self.associated_resource_id = attributes[:'associatedResourceId'] if attributes[:'associatedResourceId'] raise 'You cannot provide both :associatedResourceId and :associated_resource_id' if attributes.key?(:'associatedResourceId') && attributes.key?(:'associated_resource_id') self.associated_resource_id = attributes[:'associated_resource_id'] if attributes[:'associated_resource_id'] self.associated_resource_name = attributes[:'associatedResourceName'] if attributes[:'associatedResourceName'] raise 'You cannot provide both :associatedResourceName and :associated_resource_name' if attributes.key?(:'associatedResourceName') && attributes.key?(:'associated_resource_name') self.associated_resource_name = attributes[:'associated_resource_name'] if attributes[:'associated_resource_name'] 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.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated'] raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated') self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated'] end |
Instance Attribute Details
#associated_resource_id ⇒ String
The OCID of the resource that is associated with the attribute set.
24 25 26 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 24 def associated_resource_id @associated_resource_id end |
#associated_resource_name ⇒ String
The display name of the resource that is associated with the attribute set. The name does not have to be unique, and is changeable.
28 29 30 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 28 def associated_resource_name @associated_resource_name end |
#associated_resource_type ⇒ String
The resource type that is associated with the attribute set.
20 21 22 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 20 def associated_resource_type @associated_resource_type end |
#time_created ⇒ DateTime
The date and time when associated started between resource and the attribute set, in the format defined by RFC3339.
32 33 34 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 32 def time_created @time_created end |
#time_updated ⇒ DateTime
The date and time when associated is removed between resources and the attribute set, in the format defined by RFC3339.
36 37 38 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 36 def time_updated @time_updated end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 39 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'associated_resource_type': :'associatedResourceType', 'associated_resource_id': :'associatedResourceId', 'associated_resource_name': :'associatedResourceName', 'time_created': :'timeCreated', 'time_updated': :'timeUpdated' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 52 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'associated_resource_type': :'String', 'associated_resource_id': :'String', 'associated_resource_name': :'String', 'time_created': :'DateTime', 'time_updated': :'DateTime' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
132 133 134 135 136 137 138 139 140 141 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 132 def ==(other) return true if equal?(other) self.class == other.class && associated_resource_type == other.associated_resource_type && associated_resource_id == other.associated_resource_id && associated_resource_name == other.associated_resource_name && time_created == other.time_created && time_updated == other.time_updated end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 166 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
146 147 148 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 146 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
155 156 157 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 155 def hash [associated_resource_type, associated_resource_id, associated_resource_name, time_created, time_updated].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
199 200 201 202 203 204 205 206 207 208 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 199 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
193 194 195 |
# File 'lib/oci/data_safe/models/associated_resource_summary.rb', line 193 def to_s to_hash.to_s end |