pub struct CloudBillingClient<T> { /* private fields */ }
Expand description

Retrieves the Google Cloud Console billing accounts and associates them with projects.

Implementations§

source§

impl<T> CloudBillingClient<T>
where T: GrpcService<BoxBody>, T::Error: Into<StdError>, T::ResponseBody: Body<Data = Bytes> + Send + 'static, <T::ResponseBody as Body>::Error: Into<StdError> + Send,

source

pub fn new(inner: T) -> Self

source

pub fn with_origin(inner: T, origin: Uri) -> Self

source

pub fn with_interceptor<F>( inner: T, interceptor: F ) -> CloudBillingClient<InterceptedService<T, F>>
where F: Interceptor, T::ResponseBody: Default, T: Service<Request<BoxBody>, Response = Response<<T as GrpcService<BoxBody>>::ResponseBody>>, <T as Service<Request<BoxBody>>>::Error: Into<StdError> + Send + Sync,

source

pub fn send_compressed(self, encoding: CompressionEncoding) -> Self

Compress requests with the given encoding.

This requires the server to support it otherwise it might respond with an error.

source

pub fn accept_compressed(self, encoding: CompressionEncoding) -> Self

Enable decompressing responses.

source

pub fn max_decoding_message_size(self, limit: usize) -> Self

Limits the maximum size of a decoded message.

Default: 4MB

source

pub fn max_encoding_message_size(self, limit: usize) -> Self

Limits the maximum size of an encoded message.

Default: usize::MAX

source

pub async fn get_billing_account( &mut self, request: impl IntoRequest<GetBillingAccountRequest> ) -> Result<Response<BillingAccount>, Status>

Gets information about a billing account. The current authenticated user must be a viewer of the billing account.

source

pub async fn list_billing_accounts( &mut self, request: impl IntoRequest<ListBillingAccountsRequest> ) -> Result<Response<ListBillingAccountsResponse>, Status>

Lists the billing accounts that the current authenticated user has permission to view.

source

pub async fn update_billing_account( &mut self, request: impl IntoRequest<UpdateBillingAccountRequest> ) -> Result<Response<BillingAccount>, Status>

Updates a billing account’s fields. Currently the only field that can be edited is display_name. The current authenticated user must have the billing.accounts.update IAM permission, which is typically given to the administrator of the billing account.

source

pub async fn create_billing_account( &mut self, request: impl IntoRequest<CreateBillingAccountRequest> ) -> Result<Response<BillingAccount>, Status>

This method creates billing subaccounts.

Google Cloud resellers should use the Channel Services APIs, accounts.customers.create and accounts.customers.entitlements.create.

When creating a subaccount, the current authenticated user must have the billing.accounts.update IAM permission on the parent account, which is typically given to billing account administrators. This method will return an error if the parent account has not been provisioned for subaccounts.

source

pub async fn list_project_billing_info( &mut self, request: impl IntoRequest<ListProjectBillingInfoRequest> ) -> Result<Response<ListProjectBillingInfoResponse>, Status>

Lists the projects associated with a billing account. The current authenticated user must have the billing.resourceAssociations.list IAM permission, which is often given to billing account viewers.

source

pub async fn get_project_billing_info( &mut self, request: impl IntoRequest<GetProjectBillingInfoRequest> ) -> Result<Response<ProjectBillingInfo>, Status>

Gets the billing information for a project. The current authenticated user must have the resourcemanager.projects.get permission for the project, which can be granted by assigning the Project Viewer role.

source

pub async fn update_project_billing_info( &mut self, request: impl IntoRequest<UpdateProjectBillingInfoRequest> ) -> Result<Response<ProjectBillingInfo>, Status>

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 might 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 and the billing account.

You 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.

source

pub async fn get_iam_policy( &mut self, request: impl IntoRequest<GetIamPolicyRequest> ) -> Result<Response<Policy>, Status>

Gets the access control policy for a billing account. The caller must have the billing.accounts.getIamPolicy permission on the account, which is often given to billing account viewers.

source

pub async fn set_iam_policy( &mut self, request: impl IntoRequest<SetIamPolicyRequest> ) -> Result<Response<Policy>, Status>

Sets the access control policy for a billing account. Replaces any existing policy. The caller must have the billing.accounts.setIamPolicy permission on the account, which is often given to billing account administrators.

source

pub async fn test_iam_permissions( &mut self, request: impl IntoRequest<TestIamPermissionsRequest> ) -> Result<Response<TestIamPermissionsResponse>, Status>

Tests the access control policy for a billing account. This method takes the resource and a set of permissions as input and returns the subset of the input permissions that the caller is allowed for that resource.

source

pub async fn move_billing_account( &mut self, request: impl IntoRequest<MoveBillingAccountRequest> ) -> Result<Response<BillingAccount>, Status>

Changes which parent organization a billing account belongs to.

Trait Implementations§

source§

impl<T: Clone> Clone for CloudBillingClient<T>

source§

fn clone(&self) -> CloudBillingClient<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Debug> Debug for CloudBillingClient<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> !Freeze for CloudBillingClient<T>

§

impl<T> RefUnwindSafe for CloudBillingClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for CloudBillingClient<T>
where T: Send,

§

impl<T> Sync for CloudBillingClient<T>
where T: Sync,

§

impl<T> Unpin for CloudBillingClient<T>
where T: Unpin,

§

impl<T> UnwindSafe for CloudBillingClient<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more