Class: Google::Apis::CloudbillingV1beta::UsageRateTimeline

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/cloudbilling_v1beta/classes.rb,
lib/google/apis/cloudbilling_v1beta/representations.rb,
lib/google/apis/cloudbilling_v1beta/representations.rb

Overview

A timeline of usage rates. Consists of a series of entries, each of which specifies a constant rate of usage during a time interval. Each entry contains an effective time. The usage rate is in effect from that time until the effective time of the subsequent entry, or, for the last entry, for the remaining portion of estimation time frame. Effective times are specified as an offset into the estimation time frame. Usage is considered to be zero until the effective_time of the first entry. All subsequent entries must have an effective time greater than the previous entry and less than the estimate time frame. The effective time on all entries must be an integer number of hours.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ UsageRateTimeline

Returns a new instance of UsageRateTimeline.



2809
2810
2811
# File 'lib/google/apis/cloudbilling_v1beta/classes.rb', line 2809

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#unitString

The unit for the usage rate in each timeline entry. If you provide an incorrect unit for an instance, the correct unit is provided in the error message. The supported units are a subset of The Unified Code for Units of Measure standard: * Time units (TIME-UNIT) * s second * min minute * h hour * d day * wk week * mo month * yr year * ms millisecond * us microsecond * ns nanosecond * Basic storage units (BASIC-STORAGE-UNIT) * bit bit * By byte * Count units (COUNT- UNIT) * count count * Prefixes (PREFIX) * k kilo (10^3) * M mega ( 10^6) * G giga (10^9) * T tera (10^12) * P peta (10^15) * Ki kibi (2^ 10) * Mi mebi (2^20) * Gi gibi (2^30) * Ti tebi (2^40) * Pi pebi (2^50) Grammar The grammar also includes these connectors: * / division or ratio (as an infix operator). For example: kBy/emailor `MiBy/10ms`. * `.` multiplication or composition (as an infix operator). For example: `GBy.d` or ` k`watt`.h`. The grammar for a unit is as follows:Expression = Component "." Component "/" Component ; Component = ( [ PREFIX ] UNIT | "%" ) [ Annotation ] | Annotation | "1" ; UNIT = TIME-UNIT | STORAGE-UNIT | DATA-UNIT | COUNT-UNIT Annotation = "" NAME "" ;Examples: * Request per second: `1/ s` orrequests/s * GibiBytes: GiBy * GibiBytes * seconds: GiBy.s Corresponds to the JSON property unit

Returns:

  • (String)


2800
2801
2802
# File 'lib/google/apis/cloudbilling_v1beta/classes.rb', line 2800

def unit
  @unit
end

#usage_rate_timeline_entriesArray<Google::Apis::CloudbillingV1beta::UsageRateTimelineEntry>

The timeline entries. Each entry has a start time and usage rate. The start time specifies the effective time of the usage rate. The entries must be sorted by start time in an increasing order. Corresponds to the JSON property usageRateTimelineEntries



2807
2808
2809
# File 'lib/google/apis/cloudbilling_v1beta/classes.rb', line 2807

def usage_rate_timeline_entries
  @usage_rate_timeline_entries
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2814
2815
2816
2817
# File 'lib/google/apis/cloudbilling_v1beta/classes.rb', line 2814

def update!(**args)
  @unit = args[:unit] if args.key?(:unit)
  @usage_rate_timeline_entries = args[:usage_rate_timeline_entries] if args.key?(:usage_rate_timeline_entries)
end