Class: OCI::Opsi::Models::AwrSourceSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/opsi/models/awr_source_summary.rb

Overview

Summary of an AwrSource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AwrSourceSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 95

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

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

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

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

  self.awr_source_database_id = attributes[:'awrSourceDatabaseId'] if attributes[:'awrSourceDatabaseId']

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

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

  self.snapshots_uploaded = attributes[:'snapshotsUploaded'] if attributes[:'snapshotsUploaded']

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

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

  self.min_snapshot_identifier = attributes[:'minSnapshotIdentifier'] if attributes[:'minSnapshotIdentifier']

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

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

  self.max_snapshot_identifier = attributes[:'maxSnapshotIdentifier'] if attributes[:'maxSnapshotIdentifier']

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

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

  self.time_first_snapshot_generated = attributes[:'timeFirstSnapshotGenerated'] if attributes[:'timeFirstSnapshotGenerated']

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

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

  self.time_last_snapshot_generated = attributes[:'timeLastSnapshotGenerated'] if attributes[:'timeLastSnapshotGenerated']

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

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

  self.hours_since_last_import = attributes[:'hoursSinceLastImport'] if attributes[:'hoursSinceLastImport']

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

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

Instance Attribute Details

#awr_hub_idString

**[Required]** AWR Hub OCID

Returns:

  • (String)


12
13
14
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 12

def awr_hub_id
  @awr_hub_id
end

#awr_source_database_idString

**[Required]** DatabaseId of the Source database for which AWR Data will be uploaded to AWR Hub.

Returns:

  • (String)


20
21
22
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 20

def awr_source_database_id
  @awr_source_database_id
end

#hours_since_last_importFloat

**[Required]** Number of hours since last AWR snapshots import happened from the Source database.

Returns:

  • (Float)


44
45
46
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 44

def hours_since_last_import
  @hours_since_last_import
end

#max_snapshot_identifierFloat

**[Required]** The maximum snapshot identifier of the source database for which AWR data is uploaded to AWR Hub.

Returns:

  • (Float)


32
33
34
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 32

def max_snapshot_identifier
  @max_snapshot_identifier
end

#min_snapshot_identifierFloat

**[Required]** The minimum snapshot identifier of the source database for which AWR data is uploaded to AWR Hub.

Returns:

  • (Float)


28
29
30
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 28

def min_snapshot_identifier
  @min_snapshot_identifier
end

#nameString

**[Required]** Database name of the Source database for which AWR Data will be uploaded to AWR Hub.

Returns:

  • (String)


16
17
18
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 16

def name
  @name
end

#snapshots_uploadedFloat

**[Required]** Number of AWR snapshots uploaded from the Source database.

Returns:

  • (Float)


24
25
26
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 24

def snapshots_uploaded
  @snapshots_uploaded
end

#time_first_snapshot_generatedDateTime

**[Required]** The time at which the earliest snapshot was generated in the source database for which data is uploaded to AWR Hub. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


36
37
38
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 36

def time_first_snapshot_generated
  @time_first_snapshot_generated
end

#time_last_snapshot_generatedDateTime

**[Required]** The time at which the latest snapshot was generated in the source database for which data is uploaded to AWR Hub. An RFC3339 formatted datetime string

Returns:

  • (DateTime)


40
41
42
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 40

def time_last_snapshot_generated
  @time_last_snapshot_generated
end

Class Method Details

.attribute_mapObject

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



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 47

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'awr_hub_id': :'awrHubId',
    'name': :'name',
    'awr_source_database_id': :'awrSourceDatabaseId',
    'snapshots_uploaded': :'snapshotsUploaded',
    'min_snapshot_identifier': :'minSnapshotIdentifier',
    'max_snapshot_identifier': :'maxSnapshotIdentifier',
    'time_first_snapshot_generated': :'timeFirstSnapshotGenerated',
    'time_last_snapshot_generated': :'timeLastSnapshotGenerated',
    'hours_since_last_import': :'hoursSinceLastImport'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'awr_hub_id': :'String',
    'name': :'String',
    'awr_source_database_id': :'String',
    'snapshots_uploaded': :'Float',
    'min_snapshot_identifier': :'Float',
    'max_snapshot_identifier': :'Float',
    'time_first_snapshot_generated': :'DateTime',
    'time_last_snapshot_generated': :'DateTime',
    'hours_since_last_import': :'Float'
    # 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
171
172
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 159

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

  self.class == other.class &&
    awr_hub_id == other.awr_hub_id &&
    name == other.name &&
    awr_source_database_id == other.awr_source_database_id &&
    snapshots_uploaded == other.snapshots_uploaded &&
    min_snapshot_identifier == other.min_snapshot_identifier &&
    max_snapshot_identifier == other.max_snapshot_identifier &&
    time_first_snapshot_generated == other.time_first_snapshot_generated &&
    time_last_snapshot_generated == other.time_last_snapshot_generated &&
    hours_since_last_import == other.hours_since_last_import
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



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

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


177
178
179
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 177

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



186
187
188
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 186

def hash
  [awr_hub_id, name, awr_source_database_id, snapshots_uploaded, min_snapshot_identifier, max_snapshot_identifier, time_first_snapshot_generated, time_last_snapshot_generated, hours_since_last_import].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



230
231
232
233
234
235
236
237
238
239
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 230

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



224
225
226
# File 'lib/oci/opsi/models/awr_source_summary.rb', line 224

def to_s
  to_hash.to_s
end