cloudbilling

package
v0.0.0-...-0b0e2e0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2017 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Overview

Package cloudbilling provides access to the Google Cloud Billing API.

See https://cloud.google.com/billing/

Usage example:

import "google.golang.org/api/cloudbilling/v1"
...
cloudbillingService, err := cloudbilling.New(oauthHttpClient)

Index

Constants

View Source
const (
	// View and manage your data across Google Cloud Platform services
	CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIService

type APIService struct {
	BasePath  string // API endpoint base URL
	UserAgent string // optional additional User-Agent fragment

	BillingAccounts *BillingAccountsService

	Projects *ProjectsService

	Services *ServicesService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*APIService, error)

type AggregationInfo

type AggregationInfo struct {
	// AggregationCount: The number of intervals to aggregate over.
	// Example: If aggregation_level is "DAILY" and aggregation_count is
	// 14,
	// aggregation will be over 14 days.
	AggregationCount int64 `json:"aggregationCount,omitempty"`

	// Possible values:
	//   "AGGREGATION_INTERVAL_UNSPECIFIED"
	//   "DAILY"
	//   "MONTHLY"
	AggregationInterval string `json:"aggregationInterval,omitempty"`

	// Possible values:
	//   "AGGREGATION_LEVEL_UNSPECIFIED"
	//   "ACCOUNT"
	//   "PROJECT"
	AggregationLevel string `json:"aggregationLevel,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AggregationCount") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AggregationCount") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

AggregationInfo: Represents the aggregation level and interval for pricing of a single SKU.

func (*AggregationInfo) MarshalJSON

func (s *AggregationInfo) MarshalJSON() ([]byte, error)

type BillingAccount

type BillingAccount struct {
	// DisplayName: The display name given to the billing account, such as
	// `My Billing
	// Account`. This name is displayed in the Google Cloud Console.
	DisplayName string `json:"displayName,omitempty"`

	// Name: The resource name of the billing account. The resource name has
	// the form
	// `billingAccounts/{billing_account_id}`. For
	// example,
	// `billingAccounts/012345-567890-ABCDEF` would be the resource name
	// for
	// billing account `012345-567890-ABCDEF`.
	Name string `json:"name,omitempty"`

	// Open: True if the billing account is open, and will therefore be
	// charged for any
	// usage on associated projects. False if the billing account is closed,
	// and
	// therefore projects associated with it will be unable to use paid
	// services.
	Open bool `json:"open,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "DisplayName") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DisplayName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

BillingAccount: A billing account in [Google Cloud Console](https://console.cloud.google.com/). You can assign a billing account to one or more projects.

func (*BillingAccount) MarshalJSON

func (s *BillingAccount) MarshalJSON() ([]byte, error)

type BillingAccountsGetCall

type BillingAccountsGetCall struct {
	// contains filtered or unexported fields
}

func (*BillingAccountsGetCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*BillingAccountsGetCall) Do

Do executes the "cloudbilling.billingAccounts.get" call. Exactly one of *BillingAccount or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *BillingAccount.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*BillingAccountsGetCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*BillingAccountsGetCall) Header

func (c *BillingAccountsGetCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*BillingAccountsGetCall) IfNoneMatch

func (c *BillingAccountsGetCall) IfNoneMatch(entityTag string) *BillingAccountsGetCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type BillingAccountsListCall

type BillingAccountsListCall struct {
	// contains filtered or unexported fields
}

func (*BillingAccountsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*BillingAccountsListCall) Do

Do executes the "cloudbilling.billingAccounts.list" call. Exactly one of *ListBillingAccountsResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListBillingAccountsResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*BillingAccountsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*BillingAccountsListCall) Header

func (c *BillingAccountsListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*BillingAccountsListCall) IfNoneMatch

func (c *BillingAccountsListCall) IfNoneMatch(entityTag string) *BillingAccountsListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*BillingAccountsListCall) PageSize

func (c *BillingAccountsListCall) PageSize(pageSize int64) *BillingAccountsListCall

PageSize sets the optional parameter "pageSize": Requested page size. The maximum page size is 100; this is also the default.

func (*BillingAccountsListCall) PageToken

func (c *BillingAccountsListCall) PageToken(pageToken string) *BillingAccountsListCall

PageToken sets the optional parameter "pageToken": A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListBillingAccounts` call. If unspecified, the first page of results is returned.

func (*BillingAccountsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type BillingAccountsProjectsListCall

type BillingAccountsProjectsListCall struct {
	// contains filtered or unexported fields
}

func (*BillingAccountsProjectsListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*BillingAccountsProjectsListCall) Do

Do executes the "cloudbilling.billingAccounts.projects.list" call. Exactly one of *ListProjectBillingInfoResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListProjectBillingInfoResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*BillingAccountsProjectsListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*BillingAccountsProjectsListCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*BillingAccountsProjectsListCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*BillingAccountsProjectsListCall) PageSize

PageSize sets the optional parameter "pageSize": Requested page size. The maximum page size is 100; this is also the default.

func (*BillingAccountsProjectsListCall) PageToken

PageToken sets the optional parameter "pageToken": A token identifying a page of results to be returned. This should be a `next_page_token` value returned from a previous `ListProjectBillingInfo` call. If unspecified, the first page of results is returned.

func (*BillingAccountsProjectsListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type BillingAccountsProjectsService

type BillingAccountsProjectsService struct {
	// contains filtered or unexported fields
}

func NewBillingAccountsProjectsService

func NewBillingAccountsProjectsService(s *APIService) *BillingAccountsProjectsService

func (*BillingAccountsProjectsService) List

List: Lists the projects associated with a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).

type BillingAccountsService

type BillingAccountsService struct {
	Projects *BillingAccountsProjectsService
	// contains filtered or unexported fields
}

func NewBillingAccountsService

func NewBillingAccountsService(s *APIService) *BillingAccountsService

func (*BillingAccountsService) Get

Get: Gets information about a billing account. The current authenticated user must be an [owner of the billing account](https://support.google.com/cloud/answer/4430947).

func (*BillingAccountsService) List

List: Lists the billing accounts that the current authenticated user [owns](https://support.google.com/cloud/answer/4430947).

type Category

type Category struct {
	// ResourceFamily: The type of product the SKU refers to.
	// Example: "Compute", "Storage", "Network", "ApplicationServices" etc.
	ResourceFamily string `json:"resourceFamily,omitempty"`

	// ResourceGroup: A group classification for related SKUs.
	// Example: "RAM", "GPU", "Prediction", "Ops", "GoogleEgress" etc.
	ResourceGroup string `json:"resourceGroup,omitempty"`

	// ServiceDisplayName: The display name of the service this SKU belongs
	// to.
	ServiceDisplayName string `json:"serviceDisplayName,omitempty"`

	// UsageType: Represents how the SKU is consumed.
	// Example: "OnDemand", "Preemptible", "Commit1Mo", "Commit1Yr" etc.
	UsageType string `json:"usageType,omitempty"`

	// ForceSendFields is a list of field names (e.g. "ResourceFamily") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "ResourceFamily") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

Category: Represents the category hierarchy of a SKU.

func (*Category) MarshalJSON

func (s *Category) MarshalJSON() ([]byte, error)

type ListBillingAccountsResponse

type ListBillingAccountsResponse struct {
	// BillingAccounts: A list of billing accounts.
	BillingAccounts []*BillingAccount `json:"billingAccounts,omitempty"`

	// NextPageToken: A token to retrieve the next page of results. To
	// retrieve the next page,
	// call `ListBillingAccounts` again with the `page_token` field set to
	// this
	// value. This field is empty if there are no more results to retrieve.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "BillingAccounts") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BillingAccounts") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

ListBillingAccountsResponse: Response message for `ListBillingAccounts`.

func (*ListBillingAccountsResponse) MarshalJSON

func (s *ListBillingAccountsResponse) MarshalJSON() ([]byte, error)

type ListProjectBillingInfoResponse

type ListProjectBillingInfoResponse struct {
	// NextPageToken: A token to retrieve the next page of results. To
	// retrieve the next page,
	// call `ListProjectBillingInfo` again with the `page_token` field set
	// to this
	// value. This field is empty if there are no more results to retrieve.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// ProjectBillingInfo: A list of `ProjectBillingInfo` resources
	// representing the projects
	// associated with the billing account.
	ProjectBillingInfo []*ProjectBillingInfo `json:"projectBillingInfo,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListProjectBillingInfoResponse: Request message for `ListProjectBillingInfoResponse`.

func (*ListProjectBillingInfoResponse) MarshalJSON

func (s *ListProjectBillingInfoResponse) MarshalJSON() ([]byte, error)

type ListServicesResponse

type ListServicesResponse struct {
	// NextPageToken: A token to retrieve the next page of results. To
	// retrieve the next page,
	// call `ListServices` again with the `page_token` field set to
	// this
	// value. This field is empty if there are no more results to retrieve.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// Services: A list of services.
	Services []*Service `json:"services,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListServicesResponse: Response message for `ListServices`.

func (*ListServicesResponse) MarshalJSON

func (s *ListServicesResponse) MarshalJSON() ([]byte, error)

type ListSkusResponse

type ListSkusResponse struct {
	// NextPageToken: A token to retrieve the next page of results. To
	// retrieve the next page,
	// call `ListSkus` again with the `page_token` field set to this
	// value. This field is empty if there are no more results to retrieve.
	NextPageToken string `json:"nextPageToken,omitempty"`

	// Skus: The list of public SKUs of the given service.
	Skus []*Sku `json:"skus,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "NextPageToken") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

ListSkusResponse: Response message for `ListSkus`.

func (*ListSkusResponse) MarshalJSON

func (s *ListSkusResponse) MarshalJSON() ([]byte, error)

type Money

type Money struct {
	// CurrencyCode: The 3-letter currency code defined in ISO 4217.
	CurrencyCode string `json:"currencyCode,omitempty"`

	// Nanos: Number of nano (10^-9) units of the amount.
	// The value must be between -999,999,999 and +999,999,999 inclusive.
	// If `units` is positive, `nanos` must be positive or zero.
	// If `units` is zero, `nanos` can be positive, zero, or negative.
	// If `units` is negative, `nanos` must be negative or zero.
	// For example $-1.75 is represented as `units`=-1 and
	// `nanos`=-750,000,000.
	Nanos int64 `json:"nanos,omitempty"`

	// Units: The whole units of the amount.
	// For example if `currencyCode` is "USD", then 1 unit is one US
	// dollar.
	Units int64 `json:"units,omitempty,string"`

	// ForceSendFields is a list of field names (e.g. "CurrencyCode") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "CurrencyCode") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Money: Represents an amount of money with its currency type.

func (*Money) MarshalJSON

func (s *Money) MarshalJSON() ([]byte, error)

type PricingExpression

type PricingExpression struct {
	// BaseUnit: The base unit for the SKU which is the unit used in usage
	// exports.
	// Example: "By"
	BaseUnit string `json:"baseUnit,omitempty"`

	// BaseUnitConversionFactor: Conversion factor for converting from price
	// per usage_unit to price per
	// base_unit, and start_usage_amount to start_usage_amount in
	// base_unit.
	// unit_price / base_unit_conversion_factor = price per
	// base_unit.
	// start_usage_amount * base_unit_conversion_factor = start_usage_amount
	// in
	// base_unit.
	BaseUnitConversionFactor float64 `json:"baseUnitConversionFactor,omitempty"`

	// BaseUnitDescription: The base unit in human readable form.
	// Example: "byte".
	BaseUnitDescription string `json:"baseUnitDescription,omitempty"`

	// DisplayQuantity: The recommended quantity of units for displaying
	// pricing info. When
	// displaying pricing info it is recommended to display:
	// (unit_price * display_quantity) per display_quantity usage_unit.
	// This field does not affect the pricing formula and is for display
	// purposes
	// only.
	// Example: If the unit_price is "0.0001 USD", the usage_unit is "GB"
	// and
	// the display_quantity is "1000" then the recommended way of displaying
	// the
	// pricing info is "0.10 USD per 1000 GB"
	DisplayQuantity float64 `json:"displayQuantity,omitempty"`

	// TieredRates: The list of tiered rates for this pricing. The total
	// cost is computed by
	// applying each of the tiered rates on usage. This repeated list is
	// sorted
	// by ascending order of start_usage_amount.
	TieredRates []*TierRate `json:"tieredRates,omitempty"`

	// UsageUnit: The short hand for unit of usage this pricing is specified
	// in.
	// Example: usage_unit of "GiBy" means that usage is specified in "Gibi
	// Byte".
	UsageUnit string `json:"usageUnit,omitempty"`

	// UsageUnitDescription: The unit of usage in human readable
	// form.
	// Example: "gibi byte".
	UsageUnitDescription string `json:"usageUnitDescription,omitempty"`

	// ForceSendFields is a list of field names (e.g. "BaseUnit") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BaseUnit") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

PricingExpression: Expresses a mathematical pricing formula. For Example:-

`usage_unit: GBy` `tiered_rates:`

`[start_usage_amount: 20, unit_price: $10]`
`[start_usage_amount: 100, unit_price: $5]`

The above expresses a pricing formula where the first 20GB is free, the next 80GB is priced at $10 per GB followed by $5 per GB for additional usage.

func (*PricingExpression) MarshalJSON

func (s *PricingExpression) MarshalJSON() ([]byte, error)

func (*PricingExpression) UnmarshalJSON

func (s *PricingExpression) UnmarshalJSON(data []byte) error

type PricingInfo

type PricingInfo struct {
	// AggregationInfo: Aggregation Info. This can be left unspecified if
	// the pricing expression
	// doesn't require aggregation.
	AggregationInfo *AggregationInfo `json:"aggregationInfo,omitempty"`

	// CurrencyConversionRate: Conversion rate for currency conversion, from
	// USD to the currency specified
	// in the request. If the currency is not specified this defaults to
	// 1.0.
	// Example: USD * currency_conversion_rate = JPY
	CurrencyConversionRate float64 `json:"currencyConversionRate,omitempty"`

	// EffectiveTime: The timestamp from which this pricing was effective.
	EffectiveTime string `json:"effectiveTime,omitempty"`

	// PricingExpression: Expresses the pricing formula. See
	// `PricingExpression` for an example.
	PricingExpression *PricingExpression `json:"pricingExpression,omitempty"`

	// Summary: An optional human readable summary of the pricing
	// information, has a
	// maximum length of 256 characters.
	Summary string `json:"summary,omitempty"`

	// ForceSendFields is a list of field names (e.g. "AggregationInfo") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "AggregationInfo") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

PricingInfo: Represents the pricing information for a SKU at a single point of time.

func (*PricingInfo) MarshalJSON

func (s *PricingInfo) MarshalJSON() ([]byte, error)

func (*PricingInfo) UnmarshalJSON

func (s *PricingInfo) UnmarshalJSON(data []byte) error

type ProjectBillingInfo

type ProjectBillingInfo struct {
	// BillingAccountName: The resource name of the billing account
	// associated with the project, if
	// any. For example, `billingAccounts/012345-567890-ABCDEF`.
	BillingAccountName string `json:"billingAccountName,omitempty"`

	// BillingEnabled: True if the project is associated with an open
	// billing account, to which
	// usage on the project is charged. False if the project is associated
	// with a
	// closed billing account, or no billing account at all, and therefore
	// cannot
	// use paid services. This field is read-only.
	BillingEnabled bool `json:"billingEnabled,omitempty"`

	// Name: The resource name for the `ProjectBillingInfo`; has the
	// form
	// `projects/{project_id}/billingInfo`. For example, the resource name
	// for the
	// billing information for project `tokyo-rain-123` would
	// be
	// `projects/tokyo-rain-123/billingInfo`. This field is read-only.
	Name string `json:"name,omitempty"`

	// ProjectId: The ID of the project that this `ProjectBillingInfo`
	// represents, such as
	// `tokyo-rain-123`. This is a convenience field so that you don't need
	// to
	// parse the `name` field to obtain a project ID. This field is
	// read-only.
	ProjectId string `json:"projectId,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the
	// server.
	googleapi.ServerResponse `json:"-"`

	// ForceSendFields is a list of field names (e.g. "BillingAccountName")
	// to unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "BillingAccountName") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

ProjectBillingInfo: Encapsulation of billing information for a Cloud Console project. A project has at most one associated billing account at a time (but a billing account can be assigned to multiple projects).

func (*ProjectBillingInfo) MarshalJSON

func (s *ProjectBillingInfo) MarshalJSON() ([]byte, error)

type ProjectsGetBillingInfoCall

type ProjectsGetBillingInfoCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsGetBillingInfoCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ProjectsGetBillingInfoCall) Do

Do executes the "cloudbilling.projects.getBillingInfo" call. Exactly one of *ProjectBillingInfo or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ProjectBillingInfo.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ProjectsGetBillingInfoCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ProjectsGetBillingInfoCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ProjectsGetBillingInfoCall) IfNoneMatch

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

type ProjectsService

type ProjectsService struct {
	// contains filtered or unexported fields
}

func NewProjectsService

func NewProjectsService(s *APIService) *ProjectsService

func (*ProjectsService) GetBillingInfo

func (r *ProjectsService) GetBillingInfo(name string) *ProjectsGetBillingInfoCall

GetBillingInfo: Gets the billing information for a project. The current authenticated user must have [permission to view the project](https://cloud.google.com/docs/permissions-overview#h.bgs0 oxofvnoo ).

func (*ProjectsService) UpdateBillingInfo

func (r *ProjectsService) UpdateBillingInfo(name string, projectbillinginfo *ProjectBillingInfo) *ProjectsUpdateBillingInfoCall

UpdateBillingInfo: Sets or updates the billing account associated with a project. You specify the new billing account by setting the `billing_account_name` in the `ProjectBillingInfo` resource to the resource name of a billing account. Associating a project with an open billing account enables billing on the project and allows charges for resource usage. If the project already had a billing account, this method changes the billing account used for resource usage charges.

*Note:* Incurred charges that have not yet been reported in the transaction history of the Google Cloud Console may be billed to the new billing account, even if the charge occurred before the new billing account was assigned to the project.

The current authenticated user must have ownership privileges for both the [project](https://cloud.google.com/docs/permissions-overview#h.bgs 0oxofvnoo ) and the [billing account](https://support.google.com/cloud/answer/4430947).

Y ou can disable billing on the project by setting the `billing_account_name` field to empty. This action disassociates the current billing account from the project. Any billable activity of your in-use services will stop, and your application could stop functioning as expected. Any unbilled charges to date will be billed to the previously associated account. The current authenticated user must be either an owner of the project or an owner of the billing account for the project.

Note that associating a project with a *closed* billing account will have much the same effect as disabling billing on the project: any paid resources used by the project will be shut down. Thus, unless you wish to disable billing, you should always call this method with the name of an *open* billing account.

type ProjectsUpdateBillingInfoCall

type ProjectsUpdateBillingInfoCall struct {
	// contains filtered or unexported fields
}

func (*ProjectsUpdateBillingInfoCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ProjectsUpdateBillingInfoCall) Do

Do executes the "cloudbilling.projects.updateBillingInfo" call. Exactly one of *ProjectBillingInfo or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ProjectBillingInfo.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ProjectsUpdateBillingInfoCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ProjectsUpdateBillingInfoCall) Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

type Service

type Service struct {
	// DisplayName: A human readable display name for this service.
	DisplayName string `json:"displayName,omitempty"`

	// Name: The resource name for the service.
	// Example: "services/DA34-426B-A397"
	Name string `json:"name,omitempty"`

	// ServiceId: The identifier for the service.
	// Example: "DA34-426B-A397"
	ServiceId string `json:"serviceId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "DisplayName") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "DisplayName") to include
	// in API requests with the JSON null value. By default, fields with
	// empty values are omitted from API requests. However, any field with
	// an empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Service: Encapsulates a single service in Google Cloud Platform.

func (*Service) MarshalJSON

func (s *Service) MarshalJSON() ([]byte, error)

type ServicesListCall

type ServicesListCall struct {
	// contains filtered or unexported fields
}

func (*ServicesListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ServicesListCall) Do

Do executes the "cloudbilling.services.list" call. Exactly one of *ListServicesResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListServicesResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ServicesListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ServicesListCall) Header

func (c *ServicesListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ServicesListCall) IfNoneMatch

func (c *ServicesListCall) IfNoneMatch(entityTag string) *ServicesListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ServicesListCall) PageSize

func (c *ServicesListCall) PageSize(pageSize int64) *ServicesListCall

PageSize sets the optional parameter "pageSize": Requested page size. Defaults to 5000.

func (*ServicesListCall) PageToken

func (c *ServicesListCall) PageToken(pageToken string) *ServicesListCall

PageToken sets the optional parameter "pageToken": A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListServices` call. If unspecified, the first page of results is returned.

func (*ServicesListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

type ServicesService

type ServicesService struct {
	Skus *ServicesSkusService
	// contains filtered or unexported fields
}

func NewServicesService

func NewServicesService(s *APIService) *ServicesService

func (*ServicesService) List

func (r *ServicesService) List() *ServicesListCall

List: Lists all public cloud services.

type ServicesSkusListCall

type ServicesSkusListCall struct {
	// contains filtered or unexported fields
}

func (*ServicesSkusListCall) Context

Context sets the context to be used in this call's Do method. Any pending HTTP request will be aborted if the provided context is canceled.

func (*ServicesSkusListCall) CurrencyCode

func (c *ServicesSkusListCall) CurrencyCode(currencyCode string) *ServicesSkusListCall

CurrencyCode sets the optional parameter "currencyCode": The ISO 4217 currency code for the pricing info in the response proto. Will use the conversion rate as of start_time.

If not specified USD will be used.

func (*ServicesSkusListCall) Do

Do executes the "cloudbilling.services.skus.list" call. Exactly one of *ListSkusResponse or error will be non-nil. Any non-2xx status code is an error. Response headers are in either *ListSkusResponse.ServerResponse.Header or (if a response was returned at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check whether the returned error was because http.StatusNotModified was returned.

func (*ServicesSkusListCall) EndTime

func (c *ServicesSkusListCall) EndTime(endTime string) *ServicesSkusListCall

EndTime sets the optional parameter "endTime": Optional exclusive end time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. Maximum allowable time range is 1 month (31 days). Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).

func (*ServicesSkusListCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*ServicesSkusListCall) Header

func (c *ServicesSkusListCall) Header() http.Header

Header returns an http.Header that can be modified by the caller to add HTTP headers to the request.

func (*ServicesSkusListCall) IfNoneMatch

func (c *ServicesSkusListCall) IfNoneMatch(entityTag string) *ServicesSkusListCall

IfNoneMatch sets the optional parameter which makes the operation fail if the object's ETag matches the given value. This is useful for getting updates only after the object has changed since the last request. Use googleapi.IsNotModified to check whether the response error from Do is the result of In-None-Match.

func (*ServicesSkusListCall) PageSize

func (c *ServicesSkusListCall) PageSize(pageSize int64) *ServicesSkusListCall

PageSize sets the optional parameter "pageSize": Requested page size. Defaults to 5000.

func (*ServicesSkusListCall) PageToken

func (c *ServicesSkusListCall) PageToken(pageToken string) *ServicesSkusListCall

PageToken sets the optional parameter "pageToken": A token identifying a page of results to return. This should be a `next_page_token` value returned from a previous `ListSkus` call. If unspecified, the first page of results is returned.

func (*ServicesSkusListCall) Pages

Pages invokes f for each page of results. A non-nil error returned from f will halt the iteration. The provided context supersedes any context provided to the Context method.

func (*ServicesSkusListCall) StartTime

func (c *ServicesSkusListCall) StartTime(startTime string) *ServicesSkusListCall

StartTime sets the optional parameter "startTime": Optional inclusive start time of the time range for which the pricing versions will be returned. Timestamps in the future are not allowed. Maximum allowable time range is 1 month (31 days). Time range as a whole is optional. If not specified, the latest pricing will be returned (up to 12 hours old at most).

type ServicesSkusService

type ServicesSkusService struct {
	// contains filtered or unexported fields
}

func NewServicesSkusService

func NewServicesSkusService(s *APIService) *ServicesSkusService

func (*ServicesSkusService) List

List: Lists all publicly available SKUs for a given cloud service.

type Sku

type Sku struct {
	// Category: The category hierarchy of this SKU, purely for
	// organizational purpose.
	Category *Category `json:"category,omitempty"`

	// Description: A human readable description of the SKU, has a maximum
	// length of 256
	// characters.
	Description string `json:"description,omitempty"`

	// Name: The resource name for the SKU.
	// Example: "services/DA34-426B-A397/skus/AA95-CD31-42FE"
	Name string `json:"name,omitempty"`

	// PricingInfo: A timeline of pricing info for this SKU in chronological
	// order.
	PricingInfo []*PricingInfo `json:"pricingInfo,omitempty"`

	// ServiceProviderName: Identifies the service provider.
	// This is 'Google' for first party services in Google Cloud Platform.
	ServiceProviderName string `json:"serviceProviderName,omitempty"`

	// ServiceRegions: List of service regions this SKU is offered
	// at.
	// Example: "asia-east1"
	// Service regions can be found at
	// https://cloud.google.com/about/locations/
	ServiceRegions []string `json:"serviceRegions,omitempty"`

	// SkuId: The identifier for the SKU.
	// Example: "AA95-CD31-42FE"
	SkuId string `json:"skuId,omitempty"`

	// ForceSendFields is a list of field names (e.g. "Category") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "Category") to include in
	// API requests with the JSON null value. By default, fields with empty
	// values are omitted from API requests. However, any field with an
	// empty value appearing in NullFields will be sent to the server as
	// null. It is an error if a field in this list has a non-empty value.
	// This may be used to include null fields in Patch requests.
	NullFields []string `json:"-"`
}

Sku: Encapsulates a single SKU in Google Cloud Platform

func (*Sku) MarshalJSON

func (s *Sku) MarshalJSON() ([]byte, error)

type TierRate

type TierRate struct {
	// StartUsageAmount: Usage is priced at this rate only after this
	// amount.
	// Example: start_usage_amount of 10 indicates that the usage will be
	// priced
	// at the unit_price after the first 10 usage_units.
	StartUsageAmount float64 `json:"startUsageAmount,omitempty"`

	// UnitPrice: The price per unit of usage.
	// Example: unit_price of amount $10 indicates that each unit will cost
	// $10.
	UnitPrice *Money `json:"unitPrice,omitempty"`

	// ForceSendFields is a list of field names (e.g. "StartUsageAmount") to
	// unconditionally include in API requests. By default, fields with
	// empty values are omitted from API requests. However, any non-pointer,
	// non-interface field appearing in ForceSendFields will be sent to the
	// server regardless of whether the field is empty or not. This may be
	// used to include empty fields in Patch requests.
	ForceSendFields []string `json:"-"`

	// NullFields is a list of field names (e.g. "StartUsageAmount") to
	// include in API requests with the JSON null value. By default, fields
	// with empty values are omitted from API requests. However, any field
	// with an empty value appearing in NullFields will be sent to the
	// server as null. It is an error if a field in this list has a
	// non-empty value. This may be used to include null fields in Patch
	// requests.
	NullFields []string `json:"-"`
}

TierRate: The price rate indicating starting usage and its corresponding price.

func (*TierRate) MarshalJSON

func (s *TierRate) MarshalJSON() ([]byte, error)

func (*TierRate) UnmarshalJSON

func (s *TierRate) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL