Class: OCI::LogAnalytics::Models::LogAnalyticsAssociationParameter

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/log_analytics/models/log_analytics_association_parameter.rb

Overview

LogAnalyticsAssociationParameter

Constant Summary collapse

STATUS_ENUM =
[
  STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  STATUS_FAILED = 'FAILED'.freeze,
  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 = {}) ⇒ LogAnalyticsAssociationParameter

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 117

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

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

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

  self.entity_type = attributes[:'entityType'] if attributes[:'entityType']

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

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

  self.entity_id = attributes[:'entityId'] if attributes[:'entityId']

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

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

  self.source_id = attributes[:'sourceId'] if attributes[:'sourceId']

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

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

  self.source_display_name = attributes[:'sourceDisplayName'] if attributes[:'sourceDisplayName']

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

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

  self.source_type = attributes[:'sourceType'] if attributes[:'sourceType']

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

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

  self.status = attributes[:'status'] if attributes[:'status']
  self.status = "SUCCEEDED" if status.nil? && !attributes.key?(:'status') # rubocop:disable Style/StringLiterals

  self.status_description = attributes[:'statusDescription'] if attributes[:'statusDescription']

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

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

  self.association_properties = attributes[:'associationProperties'] if attributes[:'associationProperties']

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

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

  self.missing_properties = attributes[:'missingProperties'] if attributes[:'missingProperties']

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

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

  self.required_properties = attributes[:'requiredProperties'] if attributes[:'requiredProperties']

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

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

Instance Attribute Details

#agent_idString

The agent unique identifier.

Returns:

  • (String)


20
21
22
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 20

def agent_id
  @agent_id
end

#association_propertiesArray<OCI::LogAnalytics::Models::AssociationProperty>

A list of association properties.



52
53
54
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 52

def association_properties
  @association_properties
end

#entity_idString

The entity unique identifier.

Returns:

  • (String)


28
29
30
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 28

def entity_id
  @entity_id
end

#entity_typeString

The entity type.

Returns:

  • (String)


24
25
26
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 24

def entity_type
  @entity_type
end

#missing_propertiesArray<String>

A list of missing properties.

Returns:

  • (Array<String>)


56
57
58
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 56

def missing_properties
  @missing_properties
end

#required_propertiesArray<String>

A list of requried properties.

Returns:

  • (Array<String>)


60
61
62
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 60

def required_properties
  @required_properties
end

#source_display_nameString

The source display name.

Returns:

  • (String)


36
37
38
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 36

def source_display_name
  @source_display_name
end

#source_idString

The source name.

Returns:

  • (String)


32
33
34
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 32

def source_id
  @source_id
end

#source_typeString

The source type.

Returns:

  • (String)


40
41
42
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 40

def source_type
  @source_type
end

#statusString

The status. Either FAILED or SUCCEEDED.

Returns:

  • (String)


44
45
46
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 44

def status
  @status
end

#status_descriptionString

The status description.

Returns:

  • (String)


48
49
50
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 48

def status_description
  @status_description
end

Class Method Details

.attribute_mapObject

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



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 63

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'agent_id': :'agentId',
    'entity_type': :'entityType',
    'entity_id': :'entityId',
    'source_id': :'sourceId',
    'source_display_name': :'sourceDisplayName',
    'source_type': :'sourceType',
    'status': :'status',
    'status_description': :'statusDescription',
    'association_properties': :'associationProperties',
    'missing_properties': :'missingProperties',
    'required_properties': :'requiredProperties'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 82

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'agent_id': :'String',
    'entity_type': :'String',
    'entity_id': :'String',
    'source_id': :'String',
    'source_display_name': :'String',
    'source_type': :'String',
    'status': :'String',
    'status_description': :'String',
    'association_properties': :'Array<OCI::LogAnalytics::Models::AssociationProperty>',
    'missing_properties': :'Array<String>',
    'required_properties': :'Array<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



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 207

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

  self.class == other.class &&
    agent_id == other.agent_id &&
    entity_type == other.entity_type &&
    entity_id == other.entity_id &&
    source_id == other.source_id &&
    source_display_name == other.source_display_name &&
    source_type == other.source_type &&
    status == other.status &&
    status_description == other.status_description &&
    association_properties == other.association_properties &&
    missing_properties == other.missing_properties &&
    required_properties == other.required_properties
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



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 247

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


227
228
229
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 227

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



236
237
238
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 236

def hash
  [agent_id, entity_type, entity_id, source_id, source_display_name, source_type, status, status_description, association_properties, missing_properties, required_properties].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



280
281
282
283
284
285
286
287
288
289
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 280

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



274
275
276
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 274

def to_s
  to_hash.to_s
end