Class: OCI::StackMonitoring::Models::SearchMonitoredResourceAssociationsDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb

Overview

The information required to search monitored resource associations.

Constant Summary collapse

SORT_BY_ENUM =
[
  SORT_BY_TIME_CREATED = 'TIME_CREATED'.freeze,
  SORT_BY_ASSOC_TYPE = 'ASSOC_TYPE'.freeze
].freeze
SORT_ORDER_ENUM =
[
  SORT_ORDER_ASC = 'ASC'.freeze,
  SORT_ORDER_DESC = 'DESC'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SearchMonitoredResourceAssociationsDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
186
187
188
189
190
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 123

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

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

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

  self.source_resource_name = attributes[:'sourceResourceName'] if attributes[:'sourceResourceName']

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

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

  self.source_resource_type = attributes[:'sourceResourceType'] if attributes[:'sourceResourceType']

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

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

  self.destination_resource_id = attributes[:'destinationResourceId'] if attributes[:'destinationResourceId']

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

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

  self.destination_resource_name = attributes[:'destinationResourceName'] if attributes[:'destinationResourceName']

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

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

  self.destination_resource_type = attributes[:'destinationResourceType'] if attributes[:'destinationResourceType']

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

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

  self.association_type = attributes[:'associationType'] if attributes[:'associationType']

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

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

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

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

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

  self.sort_order = attributes[:'sortOrder'] if attributes[:'sortOrder']

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

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

Instance Attribute Details

#association_typeString

Association type filter to search associated resources.

Returns:

  • (String)


59
60
61
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 59

def association_type
  @association_type
end

#compartment_idString

[Required] Compartment Identifier OCID.

Returns:

  • (String)


24
25
26
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 24

def compartment_id
  @compartment_id
end

#destination_resource_idString

Destination Monitored Resource Identifier OCID.

Returns:

  • (String)


44
45
46
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 44

def destination_resource_id
  @destination_resource_id
end

#destination_resource_nameString

Source Monitored Resource Name.

Returns:

  • (String)


49
50
51
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 49

def destination_resource_name
  @destination_resource_name
end

#destination_resource_typeString

Source Monitored Resource Type.

Returns:

  • (String)


54
55
56
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 54

def destination_resource_type
  @destination_resource_type
end

#sort_byString

The field to sort by. Only one sort order may be provided. Default order for timeCreated is descending. Default order for assocType is descending.

Returns:

  • (String)


65
66
67
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 65

def sort_by
  @sort_by
end

#sort_orderString

The sort order to use, either 'ASC' or 'DESC'.

Returns:

  • (String)


69
70
71
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 69

def sort_order
  @sort_order
end

#source_resource_idString

Source Monitored Resource Identifier OCID.

Returns:

  • (String)


29
30
31
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 29

def source_resource_id
  @source_resource_id
end

#source_resource_nameString

Source Monitored Resource Name.

Returns:

  • (String)


34
35
36
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 34

def source_resource_name
  @source_resource_name
end

#source_resource_typeString

Source Monitored Resource Type.

Returns:

  • (String)


39
40
41
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 39

def source_resource_type
  @source_resource_type
end

Class Method Details

.attribute_mapObject

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



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 72

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'source_resource_id': :'sourceResourceId',
    'source_resource_name': :'sourceResourceName',
    'source_resource_type': :'sourceResourceType',
    'destination_resource_id': :'destinationResourceId',
    'destination_resource_name': :'destinationResourceName',
    'destination_resource_type': :'destinationResourceType',
    'association_type': :'associationType',
    'sort_by': :'sortBy',
    'sort_order': :'sortOrder'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 90

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'source_resource_id': :'String',
    'source_resource_name': :'String',
    'source_resource_type': :'String',
    'destination_resource_id': :'String',
    'destination_resource_name': :'String',
    'destination_resource_type': :'String',
    'association_type': :'String',
    'sort_by': :'String',
    'sort_order': :'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



215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 215

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    source_resource_id == other.source_resource_id &&
    source_resource_name == other.source_resource_name &&
    source_resource_type == other.source_resource_type &&
    destination_resource_id == other.destination_resource_id &&
    destination_resource_name == other.destination_resource_name &&
    destination_resource_type == other.destination_resource_type &&
    association_type == other.association_type &&
    sort_by == other.sort_by &&
    sort_order == other.sort_order
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



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 254

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


234
235
236
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 234

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



243
244
245
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 243

def hash
  [compartment_id, source_resource_id, source_resource_name, source_resource_type, destination_resource_id, destination_resource_name, destination_resource_type, association_type, sort_by, sort_order].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



287
288
289
290
291
292
293
294
295
296
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 287

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



281
282
283
# File 'lib/oci/stack_monitoring/models/search_monitored_resource_associations_details.rb', line 281

def to_s
  to_hash.to_s
end