class OCI::Audit::Models::Data
The payload of the event. Information within `data` comes from the resource emitting the event.
Attributes
A container object for attribues unique to the resource emitting the event.
Example:
----- { \"imageId\": \"ocid1.image.oc1.phx.<unique_ID>\", \"shape\": \"VM.Standard1.1\", \"type\": \"CustomerVmi\" } -----
@return [Hash<String, Object>]
The availability domain where the resource resides.
@return [String]
The [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment of the resource emitting the event.
@return [String]
The name of the compartment. This value is the friendly name associated with compartmentId. This value can change, but the service logs the value that appeared at the time of the audit event.
Example: `CompartmentA`
@return [String]
This value links multiple audit events that are part of the same API operation. For example, a long running API operations that emit an event at the start and the end of an operation would use the same value in this field for both events.
@return [String]
Name of the API operation that generated this event.
Example: `GetInstance`
@return [String]
@return [OCI::Audit::Models::Identity]
@return [OCI::Audit::Models::Request]
An [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) or some other ID for the resource emitting the event.
@return [String]
The name of the resource emitting the event.
@return [String]
@return [OCI::Audit::Models::Response]
@return [OCI::Audit::Models::StateChange]
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/oci/audit/models/data.rb, line 101 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'event_grouping_id': :'eventGroupingId', 'event_name': :'eventName', 'compartment_id': :'compartmentId', 'compartment_name': :'compartmentName', 'resource_name': :'resourceName', 'resource_id': :'resourceId', 'availability_domain': :'availabilityDomain', 'freeform_tags': :'freeformTags', 'defined_tags': :'definedTags', 'identity': :'identity', 'request': :'request', 'response': :'response', 'state_change': :'stateChange', 'additional_details': :'additionalDetails' # rubocop:enable Style/SymbolLiteral } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :event_grouping_id The value to assign to the {#event_grouping_id} property @option attributes [String] :event_name The value to assign to the {#event_name} property @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property @option attributes [String] :compartment_name The value to assign to the {#compartment_name} property @option attributes [String] :resource_name The value to assign to the {#resource_name} property @option attributes [String] :resource_id The value to assign to the {#resource_id} property @option attributes [String] :availability_domain The value to assign to the {#availability_domain} property @option attributes [Hash<String, String>] :freeform_tags The value to assign to the {#freeform_tags} property @option attributes [Hash<String, Hash<String, Object>>] :defined_tags The value to assign to the {#defined_tags} property @option attributes [OCI::Audit::Models::Identity] :identity The value to assign to the {#identity} property @option attributes [OCI::Audit::Models::Request] :request The value to assign to the {#request} property @option attributes [OCI::Audit::Models::Response] :response The value to assign to the {#response} property @option attributes [OCI::Audit::Models::StateChange] :state_change The value to assign to the {#state_change} property @option attributes [Hash<String, Object>] :additional_details The value to assign to the {#additional_details} property
# File lib/oci/audit/models/data.rb, line 164 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.event_grouping_id = attributes[:'eventGroupingId'] if attributes[:'eventGroupingId'] raise 'You cannot provide both :eventGroupingId and :event_grouping_id' if attributes.key?(:'eventGroupingId') && attributes.key?(:'event_grouping_id') self.event_grouping_id = attributes[:'event_grouping_id'] if attributes[:'event_grouping_id'] self.event_name = attributes[:'eventName'] if attributes[:'eventName'] raise 'You cannot provide both :eventName and :event_name' if attributes.key?(:'eventName') && attributes.key?(:'event_name') self.event_name = attributes[:'event_name'] if attributes[:'event_name'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] self.compartment_name = attributes[:'compartmentName'] if attributes[:'compartmentName'] raise 'You cannot provide both :compartmentName and :compartment_name' if attributes.key?(:'compartmentName') && attributes.key?(:'compartment_name') self.compartment_name = attributes[:'compartment_name'] if attributes[:'compartment_name'] self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName'] raise 'You cannot provide both :resourceName and :resource_name' if attributes.key?(:'resourceName') && attributes.key?(:'resource_name') self.resource_name = attributes[:'resource_name'] if attributes[:'resource_name'] self.resource_id = attributes[:'resourceId'] if attributes[:'resourceId'] raise 'You cannot provide both :resourceId and :resource_id' if attributes.key?(:'resourceId') && attributes.key?(:'resource_id') self.resource_id = attributes[:'resource_id'] if attributes[:'resource_id'] self.availability_domain = attributes[:'availabilityDomain'] if attributes[:'availabilityDomain'] raise 'You cannot provide both :availabilityDomain and :availability_domain' if attributes.key?(:'availabilityDomain') && attributes.key?(:'availability_domain') self.availability_domain = attributes[:'availability_domain'] if attributes[:'availability_domain'] self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags'] raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags') self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags'] self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags'] raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags') self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags'] self.identity = attributes[:'identity'] if attributes[:'identity'] self.request = attributes[:'request'] if attributes[:'request'] self.response = attributes[:'response'] if attributes[:'response'] self.state_change = attributes[:'stateChange'] if attributes[:'stateChange'] raise 'You cannot provide both :stateChange and :state_change' if attributes.key?(:'stateChange') && attributes.key?(:'state_change') self.state_change = attributes[:'state_change'] if attributes[:'state_change'] self.additional_details = attributes[:'additionalDetails'] if attributes[:'additionalDetails'] raise 'You cannot provide both :additionalDetails and :additional_details' if attributes.key?(:'additionalDetails') && attributes.key?(:'additional_details') self.additional_details = attributes[:'additional_details'] if attributes[:'additional_details'] end
Attribute type mapping.
# File lib/oci/audit/models/data.rb, line 123 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'event_grouping_id': :'String', 'event_name': :'String', 'compartment_id': :'String', 'compartment_name': :'String', 'resource_name': :'String', 'resource_id': :'String', 'availability_domain': :'String', 'freeform_tags': :'Hash<String, String>', 'defined_tags': :'Hash<String, Hash<String, Object>>', 'identity': :'OCI::Audit::Models::Identity', 'request': :'OCI::Audit::Models::Request', 'response': :'OCI::Audit::Models::Response', 'state_change': :'OCI::Audit::Models::StateChange', 'additional_details': :'Hash<String, Object>' # rubocop:enable Style/SymbolLiteral } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] other the other object to be compared
# File lib/oci/audit/models/data.rb, line 250 def ==(other) return true if equal?(other) self.class == other.class && event_grouping_id == other.event_grouping_id && event_name == other.event_name && compartment_id == other.compartment_id && compartment_name == other.compartment_name && resource_name == other.resource_name && resource_id == other.resource_id && availability_domain == other.availability_domain && freeform_tags == other.freeform_tags && defined_tags == other.defined_tags && identity == other.identity && request == other.request && response == other.response && state_change == other.state_change && additional_details == other.additional_details end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/oci/audit/models/data.rb, line 293 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
@see the `==` method @param [Object] other the other object to be compared
# File lib/oci/audit/models/data.rb, line 273 def eql?(other) self == other end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/oci/audit/models/data.rb, line 282 def hash [event_grouping_id, event_name, compartment_id, compartment_name, resource_name, resource_id, availability_domain, freeform_tags, defined_tags, identity, request, response, state_change, additional_details].hash end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/oci/audit/models/data.rb, line 326 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/oci/audit/models/data.rb, line 320 def to_s to_hash.to_s end
Private Instance Methods
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/oci/audit/models/data.rb, line 343 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end