Class: OCI::UsageApi::Models::SavedCustomTable

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/usage_api/models/saved_custom_table.rb

Overview

The custom table for Cost Analysis UI rendering.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SavedCustomTable

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



88
89
90
91
92
93
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
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 88

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

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

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

  self.row_group_by = attributes[:'rowGroupBy'] if attributes[:'rowGroupBy']

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

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

  self.column_group_by = attributes[:'columnGroupBy'] if attributes[:'columnGroupBy']

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

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

  self.group_by_tag = attributes[:'groupByTag'] if attributes[:'groupByTag']

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

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

  self.compartment_depth = attributes[:'compartmentDepth'] if attributes[:'compartmentDepth']

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

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

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

Instance Attribute Details

#column_group_byArray<String>

The column groupBy key list. example: [\"tagNamespace\", \"tagKey\", \"tagValue\", \"service\", \"skuName\", \"skuPartNumber\", \"unit\", \"compartmentName\", \"compartmentPath\", \"compartmentId\", \"platform\", \"region\", \"logicalAd\", \"resourceId\", \"tenantId\", \"tenantName\"]

Returns:

  • (Array<String>)


31
32
33
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 31

def column_group_by
  @column_group_by
end

#compartment_depthFloat

The compartment depth level.

Returns:

  • (Float)


42
43
44
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 42

def compartment_depth
  @compartment_depth
end

#display_nameString

[Required] The name of the custom table.

Returns:

  • (String)


13
14
15
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 13

def display_name
  @display_name
end

#group_by_tagArray<OCI::UsageApi::Models::Tag>

GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only one tag in the list is supported. For example: [{\"namespace\":\"oracle\", \"key\":\"createdBy\"]

Returns:



38
39
40
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 38

def group_by_tag
  @group_by_tag
end

#row_group_byArray<String>

The row groupBy key list. example: [\"tagNamespace\", \"tagKey\", \"tagValue\", \"service\", \"skuName\", \"skuPartNumber\", \"unit\", \"compartmentName\", \"compartmentPath\", \"compartmentId\", \"platform\", \"region\", \"logicalAd\", \"resourceId\", \"tenantId\", \"tenantName\"]

Returns:

  • (Array<String>)


22
23
24
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 22

def row_group_by
  @row_group_by
end

#versionFloat

The version of the custom table.

Returns:

  • (Float)


46
47
48
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 46

def version
  @version
end

Class Method Details

.attribute_mapObject

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



49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 49

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'displayName',
    'row_group_by': :'rowGroupBy',
    'column_group_by': :'columnGroupBy',
    'group_by_tag': :'groupByTag',
    'compartment_depth': :'compartmentDepth',
    'version': :'version'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 63

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'display_name': :'String',
    'row_group_by': :'Array<String>',
    'column_group_by': :'Array<String>',
    'group_by_tag': :'Array<OCI::UsageApi::Models::Tag>',
    'compartment_depth': :'Float',
    'version': :'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



134
135
136
137
138
139
140
141
142
143
144
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 134

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

  self.class == other.class &&
    display_name == other.display_name &&
    row_group_by == other.row_group_by &&
    column_group_by == other.column_group_by &&
    group_by_tag == other.group_by_tag &&
    compartment_depth == other.compartment_depth &&
    version == other.version
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



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/usage_api/models/saved_custom_table.rb', line 169

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


149
150
151
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 149

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



158
159
160
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 158

def hash
  [display_name, row_group_by, column_group_by, group_by_tag, compartment_depth, version].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



202
203
204
205
206
207
208
209
210
211
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 202

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



196
197
198
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 196

def to_s
  to_hash.to_s
end