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):

  • :agent_id (String)

    The value to assign to the #agent_id property

  • :entity_type (String)

    The value to assign to the #entity_type property

  • :entity_id (String)

    The value to assign to the #entity_id property

  • :source_id (String)

    The value to assign to the #source_id property

  • :source_display_name (String)

    The value to assign to the #source_display_name property

  • :source_type (String)

    The value to assign to the #source_type property

  • :status (String)

    The value to assign to the #status property

  • :missing_properties (Array<String>)

    The value to assign to the #missing_properties property

  • :required_properties (Array<String>)

    The value to assign to the #required_properties property



102
103
104
105
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
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 102

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.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)


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

def agent_id
  @agent_id
end

#entity_idString

The entity unique identifier.

Returns:

  • (String)


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

def entity_id
  @entity_id
end

#entity_typeString

The entity type.

Returns:

  • (String)


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

def entity_type
  @entity_type
end

#missing_propertiesArray<String>

A list of missing properties.

Returns:

  • (Array<String>)


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

def missing_properties
  @missing_properties
end

#required_propertiesArray<String>

A list of requried properties.

Returns:

  • (Array<String>)


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

def required_properties
  @required_properties
end

#source_display_nameString

The source display name.

Returns:

  • (String)


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

def source_display_name
  @source_display_name
end

#source_idString

The source name.

Returns:

  • (String)


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

def source_id
  @source_id
end

#source_typeString

The source type.

Returns:

  • (String)


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

def source_type
  @source_type
end

#statusString

The status. Either FAILED or SUCCEEDED.

Returns:

  • (String)


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

def status
  @status
end

Class Method Details

.attribute_mapObject

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



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 54

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',
    'missing_properties': :'missingProperties',
    'required_properties': :'requiredProperties'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 71

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



180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 180

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 &&
    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



218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 218

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


198
199
200
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 198

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



207
208
209
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 207

def hash
  [agent_id, entity_type, entity_id, source_id, source_display_name, source_type, status, 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



251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 251

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



245
246
247
# File 'lib/oci/log_analytics/models/log_analytics_association_parameter.rb', line 245

def to_s
  to_hash.to_s
end