Class: OCI::Audit::Models::AuditEvent
- Inherits:
-
Object
- Object
- OCI::Audit::Models::AuditEvent
- Defined in:
- lib/oci/audit/models/audit_event.rb
Overview
All the attributes of an audit event. For more information, see [Viewing Audit Log Events](docs.cloud.oracle.com/iaas/Content/Audit/Tasks/viewinglogevents.htm).
Instance Attribute Summary collapse
-
#cloud_events_version ⇒ String
The version of the CloudEvents specification.
-
#content_type ⇒ String
The content type of the data contained in ‘data`.
- #data ⇒ OCI::Audit::Models::Data
-
#event_id ⇒ String
The GUID of the event.
-
#event_time ⇒ DateTime
The time the event occurred, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format.
-
#event_type ⇒ String
The type of event that happened.
-
#event_type_version ⇒ String
The version of the event type.
-
#source ⇒ String
The source of the event.
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 = {}) ⇒ AuditEvent
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 = {}) ⇒ AuditEvent
Initializes the object
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 158 159 160 |
# File 'lib/oci/audit/models/audit_event.rb', line 115 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_type = attributes[:'eventType'] if attributes[:'eventType'] raise 'You cannot provide both :eventType and :event_type' if attributes.key?(:'eventType') && attributes.key?(:'event_type') self.event_type = attributes[:'event_type'] if attributes[:'event_type'] self.cloud_events_version = attributes[:'cloudEventsVersion'] if attributes[:'cloudEventsVersion'] raise 'You cannot provide both :cloudEventsVersion and :cloud_events_version' if attributes.key?(:'cloudEventsVersion') && attributes.key?(:'cloud_events_version') self.cloud_events_version = attributes[:'cloud_events_version'] if attributes[:'cloud_events_version'] self.event_type_version = attributes[:'eventTypeVersion'] if attributes[:'eventTypeVersion'] raise 'You cannot provide both :eventTypeVersion and :event_type_version' if attributes.key?(:'eventTypeVersion') && attributes.key?(:'event_type_version') self.event_type_version = attributes[:'event_type_version'] if attributes[:'event_type_version'] self.source = attributes[:'source'] if attributes[:'source'] self.event_id = attributes[:'eventId'] if attributes[:'eventId'] raise 'You cannot provide both :eventId and :event_id' if attributes.key?(:'eventId') && attributes.key?(:'event_id') self.event_id = attributes[:'event_id'] if attributes[:'event_id'] self.event_time = attributes[:'eventTime'] if attributes[:'eventTime'] raise 'You cannot provide both :eventTime and :event_time' if attributes.key?(:'eventTime') && attributes.key?(:'event_time') self.event_time = attributes[:'event_time'] if attributes[:'event_time'] self.content_type = attributes[:'contentType'] if attributes[:'contentType'] raise 'You cannot provide both :contentType and :content_type' if attributes.key?(:'contentType') && attributes.key?(:'content_type') self.content_type = attributes[:'content_type'] if attributes[:'content_type'] self.data = attributes[:'data'] if attributes[:'data'] end |
Instance Attribute Details
#cloud_events_version ⇒ String
The version of the CloudEvents specification. The structure of the envelope follows the [CloudEvents](github.com/cloudevents/spec) industry standard format hosted by the [Cloud Native Computing Foundation ( CNCF)](www.cncf.io/).
Audit uses version 0.1 specification of the CloudEvents event envelope.
Example: ‘0.1`
30 31 32 |
# File 'lib/oci/audit/models/audit_event.rb', line 30 def cloud_events_version @cloud_events_version end |
#content_type ⇒ String
The content type of the data contained in ‘data`.
Example: ‘application/json`
64 65 66 |
# File 'lib/oci/audit/models/audit_event.rb', line 64 def content_type @content_type end |
#data ⇒ OCI::Audit::Models::Data
67 68 69 |
# File 'lib/oci/audit/models/audit_event.rb', line 67 def data @data end |
#event_id ⇒ String
The GUID of the event.
50 51 52 |
# File 'lib/oci/audit/models/audit_event.rb', line 50 def event_id @event_id end |
#event_time ⇒ DateTime
The time the event occurred, expressed in [RFC 3339](tools.ietf.org/html/rfc3339) timestamp format.
Example: ‘2019-09-18T00:10:59.252Z`
57 58 59 |
# File 'lib/oci/audit/models/audit_event.rb', line 57 def event_time @event_time end |
#event_type ⇒ String
The type of event that happened.
The service that produces the event can also add, remove, or change the meaning of a field. A service implementing these type changes would publish a new version of an ‘eventType` and revise the `eventTypeVersion` field.
Example: ‘com.oraclecloud.ComputeApi.GetInstance`
19 20 21 |
# File 'lib/oci/audit/models/audit_event.rb', line 19 def event_type @event_type end |
#event_type_version ⇒ String
The version of the event type. This version applies to the payload of the event, not the envelope. Use ‘cloudEventsVersion` to determine the version of the envelope.
Example: ‘2.0`
38 39 40 |
# File 'lib/oci/audit/models/audit_event.rb', line 38 def event_type_version @event_type_version end |
#source ⇒ String
The source of the event.
Example: ‘ComputeApi`
45 46 47 |
# File 'lib/oci/audit/models/audit_event.rb', line 45 def source @source end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/oci/audit/models/audit_event.rb', line 70 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'event_type': :'eventType', 'cloud_events_version': :'cloudEventsVersion', 'event_type_version': :'eventTypeVersion', 'source': :'source', 'event_id': :'eventId', 'event_time': :'eventTime', 'content_type': :'contentType', 'data': :'data' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
# File 'lib/oci/audit/models/audit_event.rb', line 86 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'event_type': :'String', 'cloud_events_version': :'String', 'event_type_version': :'String', 'source': :'String', 'event_id': :'String', 'event_time': :'DateTime', 'content_type': :'String', 'data': :'OCI::Audit::Models::Data' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/oci/audit/models/audit_event.rb', line 169 def ==(other) return true if equal?(other) self.class == other.class && event_type == other.event_type && cloud_events_version == other.cloud_events_version && event_type_version == other.event_type_version && source == other.source && event_id == other.event_id && event_time == other.event_time && content_type == other.content_type && data == other.data end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 |
# File 'lib/oci/audit/models/audit_event.rb', line 206 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
186 187 188 |
# File 'lib/oci/audit/models/audit_event.rb', line 186 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
195 196 197 |
# File 'lib/oci/audit/models/audit_event.rb', line 195 def hash [event_type, cloud_events_version, event_type_version, source, event_id, event_time, content_type, data].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
239 240 241 242 243 244 245 246 247 248 |
# File 'lib/oci/audit/models/audit_event.rb', line 239 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
233 234 235 |
# File 'lib/oci/audit/models/audit_event.rb', line 233 def to_s to_hash.to_s end |