Class: OCI::DataCatalog::Models::EventConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_catalog/models/event_config.rb

Overview

Describes an event configuration, for a given object type and property. Primarily, whether a property change will result in an event being emitted.

Constant Summary collapse

EVENT_CONFIG_STATUS_ENUM =
[
  EVENT_CONFIG_STATUS_ENABLED = 'ENABLED'.freeze,
  EVENT_CONFIG_STATUS_DISABLED = 'DISABLED'.freeze,
  EVENT_CONFIG_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ EventConfig

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :type_id (String)

    The value to assign to the #type_id property

  • :type_name (String)

    The value to assign to the #type_name property

  • :property_id (String)

    The value to assign to the #property_id property

  • :property_name (String)

    The value to assign to the #property_name property

  • :event_config_status (String)

    The value to assign to the #event_config_status property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property

  • :created_by_id (String)

    The value to assign to the #created_by_id property

  • :updated_by_id (String)

    The value to assign to the #updated_by_id property



106
107
108
109
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
158
159
160
161
162
163
164
165
# File 'lib/oci/data_catalog/models/event_config.rb', line 106

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.type_id = attributes[:'typeId'] if attributes[:'typeId']

  raise 'You cannot provide both :typeId and :type_id' if attributes.key?(:'typeId') && attributes.key?(:'type_id')

  self.type_id = attributes[:'type_id'] if attributes[:'type_id']

  self.type_name = attributes[:'typeName'] if attributes[:'typeName']

  raise 'You cannot provide both :typeName and :type_name' if attributes.key?(:'typeName') && attributes.key?(:'type_name')

  self.type_name = attributes[:'type_name'] if attributes[:'type_name']

  self.property_id = attributes[:'propertyId'] if attributes[:'propertyId']

  raise 'You cannot provide both :propertyId and :property_id' if attributes.key?(:'propertyId') && attributes.key?(:'property_id')

  self.property_id = attributes[:'property_id'] if attributes[:'property_id']

  self.property_name = attributes[:'propertyName'] if attributes[:'propertyName']

  raise 'You cannot provide both :propertyName and :property_name' if attributes.key?(:'propertyName') && attributes.key?(:'property_name')

  self.property_name = attributes[:'property_name'] if attributes[:'property_name']

  self.event_config_status = attributes[:'eventConfigStatus'] if attributes[:'eventConfigStatus']

  raise 'You cannot provide both :eventConfigStatus and :event_config_status' if attributes.key?(:'eventConfigStatus') && attributes.key?(:'event_config_status')

  self.event_config_status = attributes[:'event_config_status'] if attributes[:'event_config_status']

  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']

  self.created_by_id = attributes[:'createdById'] if attributes[:'createdById']

  raise 'You cannot provide both :createdById and :created_by_id' if attributes.key?(:'createdById') && attributes.key?(:'created_by_id')

  self.created_by_id = attributes[:'created_by_id'] if attributes[:'created_by_id']

  self.updated_by_id = attributes[:'updatedById'] if attributes[:'updatedById']

  raise 'You cannot provide both :updatedById and :updated_by_id' if attributes.key?(:'updatedById') && attributes.key?(:'updated_by_id')

  self.updated_by_id = attributes[:'updated_by_id'] if attributes[:'updated_by_id']
end

Instance Attribute Details

#created_by_idString

OCID of the user who created the configuration.

Returns:

  • (String)


51
52
53
# File 'lib/oci/data_catalog/models/event_config.rb', line 51

def created_by_id
  @created_by_id
end

#event_config_statusString

Status of the configuration.

Returns:

  • (String)


36
37
38
# File 'lib/oci/data_catalog/models/event_config.rb', line 36

def event_config_status
  @event_config_status
end

#property_idString

Unique property key identifier.

Returns:

  • (String)


28
29
30
# File 'lib/oci/data_catalog/models/event_config.rb', line 28

def property_id
  @property_id
end

#property_nameString

Name of the property.

Returns:

  • (String)


32
33
34
# File 'lib/oci/data_catalog/models/event_config.rb', line 32

def property_name
  @property_name
end

#time_createdDateTime

The date and time the event was configured, in the format defined by RFC3339. Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


42
43
44
# File 'lib/oci/data_catalog/models/event_config.rb', line 42

def time_created
  @time_created
end

#time_updatedDateTime

The last time that any change was made to the configuration. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


47
48
49
# File 'lib/oci/data_catalog/models/event_config.rb', line 47

def time_updated
  @time_updated
end

#type_idString

Unique type key identifier.

Returns:

  • (String)


20
21
22
# File 'lib/oci/data_catalog/models/event_config.rb', line 20

def type_id
  @type_id
end

#type_nameString

Name of the type.

Returns:

  • (String)


24
25
26
# File 'lib/oci/data_catalog/models/event_config.rb', line 24

def type_name
  @type_name
end

#updated_by_idString

OCID of the user who last modified the configuration.

Returns:

  • (String)


55
56
57
# File 'lib/oci/data_catalog/models/event_config.rb', line 55

def updated_by_id
  @updated_by_id
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/oci/data_catalog/models/event_config.rb', line 58

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'type_id': :'typeId',
    'type_name': :'typeName',
    'property_id': :'propertyId',
    'property_name': :'propertyName',
    'event_config_status': :'eventConfigStatus',
    'time_created': :'timeCreated',
    'time_updated': :'timeUpdated',
    'created_by_id': :'createdById',
    'updated_by_id': :'updatedById'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/oci/data_catalog/models/event_config.rb', line 75

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'type_id': :'String',
    'type_name': :'String',
    'property_id': :'String',
    'property_name': :'String',
    'event_config_status': :'String',
    'time_created': :'DateTime',
    'time_updated': :'DateTime',
    'created_by_id': :'String',
    'updated_by_id': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/data_catalog/models/event_config.rb', line 187

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    type_id == other.type_id &&
    type_name == other.type_name &&
    property_id == other.property_id &&
    property_name == other.property_name &&
    event_config_status == other.event_config_status &&
    time_created == other.time_created &&
    time_updated == other.time_updated &&
    created_by_id == other.created_by_id &&
    updated_by_id == other.updated_by_id
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/oci/data_catalog/models/event_config.rb', line 225

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


205
206
207
# File 'lib/oci/data_catalog/models/event_config.rb', line 205

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



214
215
216
# File 'lib/oci/data_catalog/models/event_config.rb', line 214

def hash
  [type_id, type_name, property_id, property_name, event_config_status, time_created, time_updated, created_by_id, updated_by_id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/data_catalog/models/event_config.rb', line 258

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



252
253
254
# File 'lib/oci/data_catalog/models/event_config.rb', line 252

def to_s
  to_hash.to_s
end