compute  v1
Public Member Functions | Static Public Member Functions | List of all members
google_compute_api::FixedOrPercent Class Reference

#include <fixed_or_percent.h>

Inheritance diagram for google_compute_api::FixedOrPercent:

Public Member Functions

 FixedOrPercent (const Json::Value &storage)
 
 FixedOrPercent (Json::Value *storage)
 
virtual ~FixedOrPercent ()
 
const StringPiece GetTypeName () const
 
bool has_calculated () const
 
void clear_calculated ()
 
int32 get_calculated () const
 
void set_calculated (int32 value)
 
bool has_fixed () const
 
void clear_fixed ()
 
int32 get_fixed () const
 
void set_fixed (int32 value)
 
bool has_percent () const
 
void clear_percent ()
 
int32 get_percent () const
 
void set_percent (int32 value)
 

Static Public Member Functions

static FixedOrPercentNew ()
 

Detailed Description

Encapsulates numeric value that can be either absolute or relative.

Constructor & Destructor Documentation

◆ FixedOrPercent() [1/2]

google_compute_api::FixedOrPercent::FixedOrPercent ( const Json::Value &  storage)
explicit

Standard constructor for an immutable data object instance.

Parameters
[in]storageThe underlying data storage for this instance.

◆ FixedOrPercent() [2/2]

google_compute_api::FixedOrPercent::FixedOrPercent ( Json::Value *  storage)
explicit

Standard constructor for a mutable data object instance.

Parameters
[in]storageThe underlying data storage for this instance.

◆ ~FixedOrPercent()

google_compute_api::FixedOrPercent::~FixedOrPercent ( )
virtual

Standard destructor.

Member Function Documentation

◆ clear_calculated()

void google_compute_api::FixedOrPercent::clear_calculated ( )
inline

Clears the 'calculated' attribute.

◆ clear_fixed()

void google_compute_api::FixedOrPercent::clear_fixed ( )
inline

Clears the 'fixed' attribute.

◆ clear_percent()

void google_compute_api::FixedOrPercent::clear_percent ( )
inline

Clears the 'percent' attribute.

◆ get_calculated()

int32 google_compute_api::FixedOrPercent::get_calculated ( ) const
inline

Get the value of the 'calculated' attribute.

◆ get_fixed()

int32 google_compute_api::FixedOrPercent::get_fixed ( ) const
inline

Get the value of the 'fixed' attribute.

◆ get_percent()

int32 google_compute_api::FixedOrPercent::get_percent ( ) const
inline

Get the value of the 'percent' attribute.

◆ GetTypeName()

const StringPiece google_compute_api::FixedOrPercent::GetTypeName ( ) const
inline

Returns a string denoting the type of this data object.

Returns
google_compute_api::FixedOrPercent

◆ has_calculated()

bool google_compute_api::FixedOrPercent::has_calculated ( ) const
inline

Determine if the 'calculated' attribute was set.

Returns
true if the 'calculated' attribute was set.

◆ has_fixed()

bool google_compute_api::FixedOrPercent::has_fixed ( ) const
inline

Determine if the 'fixed' attribute was set.

Returns
true if the 'fixed' attribute was set.

◆ has_percent()

bool google_compute_api::FixedOrPercent::has_percent ( ) const
inline

Determine if the 'percent' attribute was set.

Returns
true if the 'percent' attribute was set.

◆ New()

FixedOrPercent * google_compute_api::FixedOrPercent::New ( )
static

Creates a new default instance.

Returns
Ownership is passed back to the caller.

◆ set_calculated()

void google_compute_api::FixedOrPercent::set_calculated ( int32  value)
inline

Change the 'calculated' attribute.

[Output Only] Absolute value of VM instances calculated based on the specific mode.

  • If the value is fixed, then the calculated value is equal to the fixed value.
  • If the value is a percent, then the calculated value is percent/100 * targetSize. For example, the calculated value of a 80% of a managed instance group with 150 instances would be (80/100 * 150) = 120 VM instances. If there is a remainder, the number is rounded up.
Parameters
[in]valueThe new value.

◆ set_fixed()

void google_compute_api::FixedOrPercent::set_fixed ( int32  value)
inline

Change the 'fixed' attribute.

Specifies a fixed number of VM instances. This must be a positive integer.

Parameters
[in]valueThe new value.

◆ set_percent()

void google_compute_api::FixedOrPercent::set_percent ( int32  value)
inline

Change the 'percent' attribute.

Specifies a percentage of instances between 0 to 100%, inclusive. For example, specify 80 for 80%.

Parameters
[in]valueThe new value.

The documentation for this class was generated from the following files: