Class: OCI::UsageApi::Models::RequestSummarizedUsagesDetails
- Inherits:
-
Object
- Object
- OCI::UsageApi::Models::RequestSummarizedUsagesDetails
- Defined in:
- lib/oci/usage_api/models/request_summarized_usages_details.rb
Overview
Details for the '/usage' query.
Constant Summary collapse
- GRANULARITY_ENUM =
[ GRANULARITY_HOURLY = 'HOURLY'.freeze, GRANULARITY_DAILY = 'DAILY'.freeze, GRANULARITY_MONTHLY = 'MONTHLY'.freeze, GRANULARITY_TOTAL = 'TOTAL'.freeze ].freeze
- QUERY_TYPE_ENUM =
[ QUERY_TYPE_USAGE = 'USAGE'.freeze, QUERY_TYPE_COST = 'COST'.freeze, QUERY_TYPE_CREDIT = 'CREDIT'.freeze, QUERY_TYPE_EXPIREDCREDIT = 'EXPIREDCREDIT'.freeze, QUERY_TYPE_ALLCREDIT = 'ALLCREDIT'.freeze ].freeze
Instance Attribute Summary collapse
-
#compartment_depth ⇒ Float
The compartment depth level.
- #filter ⇒ OCI::UsageApi::Models::Filter
- #forecast ⇒ OCI::UsageApi::Models::Forecast
-
#granularity ⇒ String
**[Required]** The usage granularity.
-
#group_by ⇒ Array<String>
Aggregate the result by.
-
#group_by_tag ⇒ Array<OCI::UsageApi::Models::Tag>
GroupBy a specific tagKey.
-
#is_aggregate_by_time ⇒ BOOLEAN
Whether aggregated by time.
-
#query_type ⇒ String
The query usage type.
-
#tenant_id ⇒ String
**[Required]** Tenant ID.
-
#time_usage_ended ⇒ DateTime
**[Required]** The usage end time.
-
#time_usage_started ⇒ DateTime
**[Required]** The usage start time.
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 = {}) ⇒ RequestSummarizedUsagesDetails
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 = {}) ⇒ RequestSummarizedUsagesDetails
Initializes the object
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 192 193 194 195 196 197 198 199 200 201 202 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 141 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.tenant_id = attributes[:'tenantId'] if attributes[:'tenantId'] raise 'You cannot provide both :tenantId and :tenant_id' if attributes.key?(:'tenantId') && attributes.key?(:'tenant_id') self.tenant_id = attributes[:'tenant_id'] if attributes[:'tenant_id'] self.time_usage_started = attributes[:'timeUsageStarted'] if attributes[:'timeUsageStarted'] raise 'You cannot provide both :timeUsageStarted and :time_usage_started' if attributes.key?(:'timeUsageStarted') && attributes.key?(:'time_usage_started') self.time_usage_started = attributes[:'time_usage_started'] if attributes[:'time_usage_started'] self.time_usage_ended = attributes[:'timeUsageEnded'] if attributes[:'timeUsageEnded'] raise 'You cannot provide both :timeUsageEnded and :time_usage_ended' if attributes.key?(:'timeUsageEnded') && attributes.key?(:'time_usage_ended') self.time_usage_ended = attributes[:'time_usage_ended'] if attributes[:'time_usage_ended'] self.granularity = attributes[:'granularity'] if attributes[:'granularity'] self.is_aggregate_by_time = attributes[:'isAggregateByTime'] unless attributes[:'isAggregateByTime'].nil? self.is_aggregate_by_time = false if is_aggregate_by_time.nil? && !attributes.key?(:'isAggregateByTime') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isAggregateByTime and :is_aggregate_by_time' if attributes.key?(:'isAggregateByTime') && attributes.key?(:'is_aggregate_by_time') self.is_aggregate_by_time = attributes[:'is_aggregate_by_time'] unless attributes[:'is_aggregate_by_time'].nil? self.is_aggregate_by_time = false if is_aggregate_by_time.nil? && !attributes.key?(:'isAggregateByTime') && !attributes.key?(:'is_aggregate_by_time') # rubocop:disable Style/StringLiterals self.forecast = attributes[:'forecast'] if attributes[:'forecast'] self.query_type = attributes[:'queryType'] if attributes[:'queryType'] raise 'You cannot provide both :queryType and :query_type' if attributes.key?(:'queryType') && attributes.key?(:'query_type') self.query_type = attributes[:'query_type'] if attributes[:'query_type'] self.group_by = attributes[:'groupBy'] if attributes[:'groupBy'] raise 'You cannot provide both :groupBy and :group_by' if attributes.key?(:'groupBy') && attributes.key?(:'group_by') self.group_by = attributes[:'group_by'] if attributes[:'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.filter = attributes[:'filter'] if attributes[:'filter'] end |
Instance Attribute Details
#compartment_depth ⇒ Float
The compartment depth level.
81 82 83 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 81 def compartment_depth @compartment_depth end |
#filter ⇒ OCI::UsageApi::Models::Filter
84 85 86 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 84 def filter @filter end |
#forecast ⇒ OCI::UsageApi::Models::Forecast
51 52 53 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 51 def forecast @forecast end |
#granularity ⇒ String
**[Required]** The usage granularity. HOURLY - Hourly data aggregation. DAILY - Daily data aggregation. MONTHLY - Monthly data aggregation. TOTAL - Not yet supported.
44 45 46 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 44 def granularity @granularity end |
#group_by ⇒ Array<String>
Aggregate the result by. example:
`[\"tagNamespace\", \"tagKey\", \"tagValue\", \"service\", \"skuName\", \"skuPartNumber\", \"unit\",
\"compartmentName\", \"compartmentPath\", \"compartmentId\", \"platform\", \"region\", \"logicalAd\",
\"resourceId\", \"tenantId\", \"tenantName\"]`
70 71 72 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 70 def group_by @group_by end |
#group_by_tag ⇒ Array<OCI::UsageApi::Models::Tag>
GroupBy a specific tagKey. Provide the tagNamespace and tagKey in the tag object. Only supports one tag in the list. For example:
`[{\"namespace\":\"oracle\", \"key\":\"createdBy\"]`
77 78 79 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 77 def group_by_tag @group_by_tag end |
#is_aggregate_by_time ⇒ BOOLEAN
Whether aggregated by time. If isAggregateByTime is true, all usage/cost over the query time period will be added up.
48 49 50 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 48 def is_aggregate_by_time @is_aggregate_by_time end |
#query_type ⇒ String
The query usage type. COST by default if it is missing. Usage - Query the usage data. Cost - Query the cost/billing data. Credit - Query the credit adjustments data. ExpiredCredit - Query the expired credits data. AllCredit - Query the credit adjustments and expired credit.
61 62 63 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 61 def query_type @query_type end |
#tenant_id ⇒ String
**[Required]** Tenant ID.
27 28 29 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 27 def tenant_id @tenant_id end |
#time_usage_ended ⇒ DateTime
**[Required]** The usage end time.
35 36 37 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 35 def time_usage_ended @time_usage_ended end |
#time_usage_started ⇒ DateTime
**[Required]** The usage start time.
31 32 33 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 31 def time_usage_started @time_usage_started end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 87 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'tenant_id': :'tenantId', 'time_usage_started': :'timeUsageStarted', 'time_usage_ended': :'timeUsageEnded', 'granularity': :'granularity', 'is_aggregate_by_time': :'isAggregateByTime', 'forecast': :'forecast', 'query_type': :'queryType', 'group_by': :'groupBy', 'group_by_tag': :'groupByTag', 'compartment_depth': :'compartmentDepth', 'filter': :'filter' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 106 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'tenant_id': :'String', 'time_usage_started': :'DateTime', 'time_usage_ended': :'DateTime', 'granularity': :'String', 'is_aggregate_by_time': :'BOOLEAN', 'forecast': :'OCI::UsageApi::Models::Forecast', 'query_type': :'String', 'group_by': :'Array<String>', 'group_by_tag': :'Array<OCI::UsageApi::Models::Tag>', 'compartment_depth': :'Float', 'filter': :'OCI::UsageApi::Models::Filter' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 227 def ==(other) return true if equal?(other) self.class == other.class && tenant_id == other.tenant_id && time_usage_started == other.time_usage_started && time_usage_ended == other.time_usage_ended && granularity == other.granularity && is_aggregate_by_time == other.is_aggregate_by_time && forecast == other.forecast && query_type == other.query_type && group_by == other.group_by && group_by_tag == other.group_by_tag && compartment_depth == other.compartment_depth && filter == other.filter end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 267 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
247 248 249 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 247 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
256 257 258 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 256 def hash [tenant_id, time_usage_started, time_usage_ended, granularity, is_aggregate_by_time, forecast, query_type, group_by, group_by_tag, compartment_depth, filter].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
300 301 302 303 304 305 306 307 308 309 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 300 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
294 295 296 |
# File 'lib/oci/usage_api/models/request_summarized_usages_details.rb', line 294 def to_s to_hash.to_s end |