Class: OCI::CapacityManagement::Models::OccOverviewSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/capacity_management/models/occ_overview_summary.rb

Overview

The overview summary is used to represent an array item that shall be used to represent the overview of the catalog resources along with their corresponding capacity requests.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ OccOverviewSummary

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :period_value (String)

    The value to assign to the #period_value property

  • :resource_name (String)

    The value to assign to the #resource_name property

  • :total_available (Integer)

    The value to assign to the #total_available property

  • :total_demanded (Integer)

    The value to assign to the #total_demanded property

  • :total_supplied (Integer)

    The value to assign to the #total_supplied property

  • :total_rejected (Integer)

    The value to assign to the #total_rejected property

  • :total_cancelled (Integer)

    The value to assign to the #total_cancelled property

  • :total_unfulfilled (Integer)

    The value to assign to the #total_unfulfilled property

  • :workload_type_breakdown_blob (String)

    The value to assign to the #workload_type_breakdown_blob property

  • :capacity_requests_blob (String)

    The value to assign to the #capacity_requests_blob property

  • :unit (String)

    The value to assign to the #unit property



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
186
187
188
189
190
191
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 118

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

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

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

  self.resource_name = attributes[:'resourceName'] if attributes[:'resourceName']

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

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

  self.total_available = attributes[:'totalAvailable'] if attributes[:'totalAvailable']

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

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

  self.total_demanded = attributes[:'totalDemanded'] if attributes[:'totalDemanded']

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

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

  self.total_supplied = attributes[:'totalSupplied'] if attributes[:'totalSupplied']

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

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

  self.total_rejected = attributes[:'totalRejected'] if attributes[:'totalRejected']

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

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

  self.total_cancelled = attributes[:'totalCancelled'] if attributes[:'totalCancelled']

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

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

  self.total_unfulfilled = attributes[:'totalUnfulfilled'] if attributes[:'totalUnfulfilled']

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

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

  self.workload_type_breakdown_blob = attributes[:'workloadTypeBreakdownBlob'] if attributes[:'workloadTypeBreakdownBlob']

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

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

  self.capacity_requests_blob = attributes[:'capacityRequestsBlob'] if attributes[:'capacityRequestsBlob']

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

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

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

Instance Attribute Details

#capacity_requests_blobString

A raw json blob containing all the capacity requests corresponding to the resource name

Returns:

  • (String)


54
55
56
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 54

def capacity_requests_blob
  @capacity_requests_blob
end

#compartment_idString

[Required] The OCID of the compartment from which the api call is made. This will be used for authorizing the request.

Returns:

  • (String)


14
15
16
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 14

def compartment_id
  @compartment_id
end

#period_valueString

[Required] The name of the month along with year for which this summary corresponds to.

Returns:

  • (String)


18
19
20
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 18

def period_value
  @period_value
end

#resource_nameString

[Required] The name of the resource for which we have aggregated the value.

Returns:

  • (String)


22
23
24
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 22

def resource_name
  @resource_name
end

#total_availableInteger

[Required] The quantity of the resource which is available at the end of the period of aggregationDetails model in consideration.

Returns:

  • (Integer)


26
27
28
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 26

def total_available
  @total_available
end

#total_cancelledInteger

[Required] The quantity of the resource which is cancelled by the customer. Once the capacity request was submitted, the customer can still cancel it. This field sums up those values.

Returns:

  • (Integer)


42
43
44
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 42

def total_cancelled
  @total_cancelled
end

#total_demandedInteger

[Required] The quantity of the resource which is demanded by customers via capacity requests against the resource name at the end of the time period in consideration for overview.

Returns:

  • (Integer)


30
31
32
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 30

def total_demanded
  @total_demanded
end

#total_rejectedInteger

[Required] The quantity of the resource which is rejected by Oracle.

Returns:

  • (Integer)


38
39
40
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 38

def total_rejected
  @total_rejected
end

#total_suppliedInteger

[Required] The quantity of the resource which is supplied by Oracle to the customer against the resource name at the end of the time period in consideration.

Returns:

  • (Integer)


34
35
36
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 34

def total_supplied
  @total_supplied
end

#total_unfulfilledInteger

[Required] The quantity of the resource which Oracle was unable to supply. For a given capacity request, Oracle sometimes cannot supply the entire value demanded by the customer. In such cases a partial value is provided, thereby leaving behind a portion of unfulfilled values. This field sums that up.

Returns:

  • (Integer)


46
47
48
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 46

def total_unfulfilled
  @total_unfulfilled
end

#unitString

[Required] The unit e.g SERVER in which the above values like totalAvailable, totalSupplied etc is measured.

Returns:

  • (String)


58
59
60
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 58

def unit
  @unit
end

#workload_type_breakdown_blobString

[Required] A raw json blob containing breakdown of totalAvailable, totalDemanded, totalSupplied, totalRejected, totalCancelled and totalUnfulfilled by workload types

Returns:

  • (String)


50
51
52
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 50

def workload_type_breakdown_blob
  @workload_type_breakdown_blob
end

Class Method Details

.attribute_mapObject

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



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 61

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'period_value': :'periodValue',
    'resource_name': :'resourceName',
    'total_available': :'totalAvailable',
    'total_demanded': :'totalDemanded',
    'total_supplied': :'totalSupplied',
    'total_rejected': :'totalRejected',
    'total_cancelled': :'totalCancelled',
    'total_unfulfilled': :'totalUnfulfilled',
    'workload_type_breakdown_blob': :'workloadTypeBreakdownBlob',
    'capacity_requests_blob': :'capacityRequestsBlob',
    'unit': :'unit'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'period_value': :'String',
    'resource_name': :'String',
    'total_available': :'Integer',
    'total_demanded': :'Integer',
    'total_supplied': :'Integer',
    'total_rejected': :'Integer',
    'total_cancelled': :'Integer',
    'total_unfulfilled': :'Integer',
    'workload_type_breakdown_blob': :'String',
    'capacity_requests_blob': :'String',
    'unit': :'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



200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 200

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    period_value == other.period_value &&
    resource_name == other.resource_name &&
    total_available == other.total_available &&
    total_demanded == other.total_demanded &&
    total_supplied == other.total_supplied &&
    total_rejected == other.total_rejected &&
    total_cancelled == other.total_cancelled &&
    total_unfulfilled == other.total_unfulfilled &&
    workload_type_breakdown_blob == other.workload_type_breakdown_blob &&
    capacity_requests_blob == other.capacity_requests_blob &&
    unit == other.unit
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



241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 241

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


221
222
223
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 221

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



230
231
232
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 230

def hash
  [compartment_id, period_value, resource_name, total_available, total_demanded, total_supplied, total_rejected, total_cancelled, total_unfulfilled, workload_type_breakdown_blob, capacity_requests_blob, unit].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



274
275
276
277
278
279
280
281
282
283
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 274

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



268
269
270
# File 'lib/oci/capacity_management/models/occ_overview_summary.rb', line 268

def to_s
  to_hash.to_s
end