Class: OCI::UsageApi::Models::SavedCustomTable
- Inherits:
-
Object
- Object
- OCI::UsageApi::Models::SavedCustomTable
- Defined in:
- lib/oci/usage_api/models/saved_custom_table.rb
Overview
The custom table for Cost Analysis UI rendering.
Instance Attribute Summary collapse
-
#column_group_by ⇒ Array<String>
The column groupBy key list.
-
#compartment_depth ⇒ Float
The compartment depth level.
-
#display_name ⇒ String
[Required] The name of the custom table.
-
#group_by_tag ⇒ Array<OCI::UsageApi::Models::Tag>
GroupBy a specific tagKey.
-
#row_group_by ⇒ Array<String>
The row groupBy key list.
-
#version ⇒ Float
The version of the custom table.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ SavedCustomTable
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ SavedCustomTable
Initializes the object
87 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 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 87 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_by ⇒ Array<String>
The column groupBy key list. example:
`[\"tagNamespace\", \"tagKey\", \"tagValue\", \"service\", \"skuName\", \"skuPartNumber\", \"unit\",
\"compartmentName\", \"compartmentPath\", \"compartmentId\", \"platform\", \"region\", \"logicalAd\",
\"resourceId\", \"tenantId\", \"tenantName\"]`
30 31 32 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 30 def column_group_by @column_group_by end |
#compartment_depth ⇒ Float
The compartment depth level.
41 42 43 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 41 def compartment_depth @compartment_depth end |
#display_name ⇒ String
[Required] The name of the custom table.
12 13 14 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 12 def display_name @display_name end |
#group_by_tag ⇒ Array<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\"]`
37 38 39 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 37 def group_by_tag @group_by_tag end |
#row_group_by ⇒ Array<String>
The row groupBy key list. example:
`[\"tagNamespace\", \"tagKey\", \"tagValue\", \"service\", \"skuName\", \"skuPartNumber\", \"unit\",
\"compartmentName\", \"compartmentPath\", \"compartmentId\", \"platform\", \"region\", \"logicalAd\",
\"resourceId\", \"tenantId\", \"tenantName\"]`
21 22 23 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 21 def row_group_by @row_group_by end |
#version ⇒ Float
The version of the custom table.
45 46 47 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 45 def version @version end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 48 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_types ⇒ Object
Attribute type mapping.
62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 62 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.
133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 133 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
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/usage_api/models/saved_custom_table.rb', line 168 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
148 149 150 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 148 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
157 158 159 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 157 def hash [display_name, row_group_by, column_group_by, group_by_tag, compartment_depth, version].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
201 202 203 204 205 206 207 208 209 210 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 201 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_s ⇒ String
Returns the string representation of the object
195 196 197 |
# File 'lib/oci/usage_api/models/saved_custom_table.rb', line 195 def to_s to_hash.to_s end |