Billing {sevenbridges2}R Documentation

R6 Class representing billing information.

Description

R6 Class representing a central resource for managing billing groups.

Details

This is main object for Billing

Super class

sevenbridges2::Item -> Billing

Public fields

URL

List of URL endpoints for this resource.

id

Billing group identifier.

owner

Username of the user that owns the billing group.

name

Billing group name.

type

Billing group type

pending

Billing group approval status.

disabled

Indicator of whether the billing group is disabled.

balance

Billing group balance.

Methods

Public methods


Method new()

Create a new Billing object.

Usage
Billing$new(res = NA, ...)
Arguments
res

Response containing Billing object information.

...

Other response arguments.


Method print()

Print billing group information as a bullet list.

Usage
Billing$print()
Examples
\dontrun{
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Print billing group
 billing_object$print()
}


Method reload()

Reload Billing group object.

Usage
Billing$reload(...)
Arguments
...

Other arguments that can be passed to core api() function like 'limit', 'offset', 'fields', etc.

Returns

Billing object.

Examples
\dontrun{
 # x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Reload billing group
 billing_object$reload()
}


Method analysis_breakdown()

Method for getting a analysis breakdown for a billing group.

Usage
Billing$analysis_breakdown(
  date_from = NULL,
  date_to = NULL,
  invoice = NULL,
  fields = NULL,
  limit = getOption("sevenbridges2")$limit,
  offset = getOption("sevenbridges2")$offset,
  ...
)
Arguments
date_from

A string representing the starting date for retrieving transactions analysis in the following format: mm-dd-yyyy.

date_to

A string representing the ending date for retrieving transactions analysis in the following format: mm-dd-yyyy.

invoice

A string representing invoice ID or Invoice object to show a breakdown for the specific invoice. If omitted, the current spending breakdown is returned.

fields

Selector specifying a subset of fields to include in the response.

limit

The maximum number of collection items to return for a single request. Minimum value is 1. The maximum value is 100 and the default value is 50. This is a pagination-specific attribute.

offset

The zero-based starting index in the entire collection of the first item to return. The default value is 0. This is a pagination-specific attribute.

...

Other arguments that can be passed to core api() function.

Examples
\dontrun{
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Get analysis breakdown
 billing_object$analysis_breakdown()
}


Method storage_breakdown()

Method for getting a storage breakdown for a billing group.

Usage
Billing$storage_breakdown(
  date_from = NULL,
  date_to = NULL,
  invoice = NULL,
  fields = NULL,
  limit = getOption("sevenbridges2")$limit,
  offset = getOption("sevenbridges2")$offset,
  ...
)
Arguments
date_from

A string representing the starting date for retrieving storage analysis in the following format: mm-dd-yyyy.

date_to

A string representing the ending date for retrieving storage analysis in the following format: mm-dd-yyyy.

invoice

A string representing invoice ID or Invoice object to show a breakdown for the specific invoice. If omitted, the current spending breakdown is returned.

fields

Selector specifying a subset of fields to include in the response.

limit

The maximum number of collection items to return for a single request. Minimum value is 1. The maximum value is 100 and the default value is 50. This is a pagination-specific attribute.

offset

The zero-based starting index in the entire collection of the first item to return. The default value is 0. This is a pagination-specific attribute.

...

Other arguments that can be passed to core api() function.

Examples
\dontrun{
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Get storage breakdown
 billing_object$storage_breakdown()
}


Method egress_breakdown()

Method for getting a egress breakdown for a billing group.

Usage
Billing$egress_breakdown(
  date_from = NULL,
  date_to = NULL,
  invoice = NULL,
  fields = NULL,
  limit = getOption("sevenbridges2")$limit,
  offset = getOption("sevenbridges2")$offset,
  ...
)
Arguments
date_from

A string representing the starting date for retrieving egress analysis in the following format: mm-dd-yyyy.

date_to

A string representing the ending date for retrieving egress analysis in the following format: mm-dd-yyyy.

invoice

A string representing invoice ID or Invoice object to show a breakdown for the specific invoice. If omitted, the current spending breakdown is returned.

fields

Selector specifying a subset of fields to include in the response.

limit

The maximum number of collection items to return for a single request. Minimum value is 1. The maximum value is 100 and the default value is 50. This is a pagination-specific attribute.

offset

The zero-based starting index in the entire collection of the first item to return. The default value is 0. This is a pagination-specific attribute.

...

Other arguments that can be passed to core api() function.

Examples
\dontrun{
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Get egress breakdown
 billing_object$egress_breakdown()
}


Method clone()

The objects of this class are cloneable with this method.

Usage
Billing$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `Billing$print`
## ------------------------------------------------

## Not run: 
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Print billing group
 billing_object$print()

## End(Not run)


## ------------------------------------------------
## Method `Billing$reload`
## ------------------------------------------------

## Not run: 
 # x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Reload billing group
 billing_object$reload()

## End(Not run)


## ------------------------------------------------
## Method `Billing$analysis_breakdown`
## ------------------------------------------------

## Not run: 
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Get analysis breakdown
 billing_object$analysis_breakdown()

## End(Not run)


## ------------------------------------------------
## Method `Billing$storage_breakdown`
## ------------------------------------------------

## Not run: 
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Get storage breakdown
 billing_object$storage_breakdown()

## End(Not run)


## ------------------------------------------------
## Method `Billing$egress_breakdown`
## ------------------------------------------------

## Not run: 
# x is API response when billing group is requested
 billing_object <- Billing$new(
                    res = x,
                    href = x$href,
                    auth = auth,
                    response = attr(x, "response")
                   )

 # Get egress breakdown
 billing_object$egress_breakdown()

## End(Not run)


[Package sevenbridges2 version 0.1.0 Index]