Class: OCI::CloudGuard::Models::AdhocQueryRegionalDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/cloud_guard/models/adhoc_query_regional_details.rb

Overview

Instance level status for each region.

Constant Summary collapse

REGIONAL_STATUS_ENUM =
[
  REGIONAL_STATUS_CREATING = 'CREATING'.freeze,
  REGIONAL_STATUS_CREATED = 'CREATED'.freeze,
  REGIONAL_STATUS_IN_PROGRESS = 'IN_PROGRESS'.freeze,
  REGIONAL_STATUS_PARTIALLY_COMPLETED = 'PARTIALLY_COMPLETED'.freeze,
  REGIONAL_STATUS_EXPIRED = 'EXPIRED'.freeze,
  REGIONAL_STATUS_COMPLETED = 'COMPLETED'.freeze,
  REGIONAL_STATUS_FAILED = 'FAILED'.freeze,
  REGIONAL_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 = {}) ⇒ AdhocQueryRegionalDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :region (String)

    The value to assign to the #region property

  • :regional_status (String)

    The value to assign to the #regional_status property

  • :regional_error (String)

    The value to assign to the #regional_error property

  • :expected_count (String)

    The value to assign to the #expected_count property

  • :failed_count (String)

    The value to assign to the #failed_count property

  • :succeeded_count (String)

    The value to assign to the #succeeded_count property

  • :expired_count (String)

    The value to assign to the #expired_count property



94
95
96
97
98
99
100
101
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
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 94

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

  self.regional_status = attributes[:'regionalStatus'] if attributes[:'regionalStatus']

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

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

  self.regional_error = attributes[:'regionalError'] if attributes[:'regionalError']

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

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

  self.expected_count = attributes[:'expectedCount'] if attributes[:'expectedCount']

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

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

  self.failed_count = attributes[:'failedCount'] if attributes[:'failedCount']

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

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

  self.succeeded_count = attributes[:'succeededCount'] if attributes[:'succeededCount']

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

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

  self.expired_count = attributes[:'expiredCount'] if attributes[:'expiredCount']

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

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

Instance Attribute Details

#expected_countString

Expected number of instances on which query should run

Returns:

  • (String)


37
38
39
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 37

def expected_count
  @expected_count
end

#expired_countString

Number of instances on which query expired

Returns:

  • (String)


49
50
51
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 49

def expired_count
  @expired_count
end

#failed_countString

Number of instances on which query failed

Returns:

  • (String)


41
42
43
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 41

def failed_count
  @failed_count
end

#regionString

[Required] Region name

Returns:

  • (String)


25
26
27
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 25

def region
  @region
end

#regional_errorString

error message to show if adhoc query fails in a region

Returns:

  • (String)


33
34
35
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 33

def regional_error
  @regional_error
end

#regional_statusString

adhoc query status of the region

Returns:

  • (String)


29
30
31
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 29

def regional_status
  @regional_status
end

#succeeded_countString

Number of instances on which query succeeded

Returns:

  • (String)


45
46
47
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 45

def succeeded_count
  @succeeded_count
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'region': :'region',
    'regional_status': :'regionalStatus',
    'regional_error': :'regionalError',
    'expected_count': :'expectedCount',
    'failed_count': :'failedCount',
    'succeeded_count': :'succeededCount',
    'expired_count': :'expiredCount'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 67

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'region': :'String',
    'regional_status': :'String',
    'regional_error': :'String',
    'expected_count': :'String',
    'failed_count': :'String',
    'succeeded_count': :'String',
    'expired_count': :'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



159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 159

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

  self.class == other.class &&
    region == other.region &&
    regional_status == other.regional_status &&
    regional_error == other.regional_error &&
    expected_count == other.expected_count &&
    failed_count == other.failed_count &&
    succeeded_count == other.succeeded_count &&
    expired_count == other.expired_count
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



195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 195

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


175
176
177
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 175

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



184
185
186
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 184

def hash
  [region, regional_status, regional_error, expected_count, failed_count, succeeded_count, expired_count].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



228
229
230
231
232
233
234
235
236
237
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 228

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



222
223
224
# File 'lib/oci/cloud_guard/models/adhoc_query_regional_details.rb', line 222

def to_s
  to_hash.to_s
end