Skip to content

Commit

Permalink
feat: Automated regeneration of CloudBilling client (#10945)
Browse files Browse the repository at this point in the history
Auto-created at 2024-03-12 02:36:18 +0000 using the toys pull request generator.
  • Loading branch information
yoshi-code-bot authored Mar 12, 2024
1 parent 1d0bbdd commit dd9b799
Show file tree
Hide file tree
Showing 10 changed files with 532 additions and 16 deletions.
4 changes: 2 additions & 2 deletions clients/cloud_billing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Install this package from [Hex](https://hex.pm) by adding

```elixir
def deps do
[{:google_api_cloud_billing, "~> 0.23"}]
[{:google_api_cloud_billing, "~> 0.24"}]
end
```

## For more information

Product documentation is available at [https://cloud.google.com/billing/](https://cloud.google.com/billing/).
Product documentation is available at [https://cloud.google.com/billing/docs/apis](https://cloud.google.com/billing/docs/apis).

Library reference documentation is published on Hexdocs at
[https://hexdocs.pm/google_api_cloud_billing](https://hexdocs.pm/google_api_cloud_billing).

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudBilling.V1.Api.Organizations do
@moduledoc """
API calls for all endpoints tagged `Organizations`.
"""

alias GoogleApi.CloudBilling.V1.Connection
alias GoogleApi.Gax.{Request, Response}

@library_version Mix.Project.config() |> Keyword.get(:version, "")

@doc """
This method creates [billing subaccounts](https://cloud.google.com/billing/docs/concepts#subaccounts). Google Cloud resellers should use the Channel Services APIs, [accounts.customers.create](https://cloud.google.com/channel/docs/reference/rest/v1/accounts.customers/create) and [accounts.customers.entitlements.create](https://cloud.google.com/channel/docs/reference/rest/v1/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](https://cloud.google.com/billing/docs/how-to/billing-access). This method will return an error if the parent account has not been provisioned for subaccounts.
## Parameters
* `connection` (*type:* `GoogleApi.CloudBilling.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. The parent to create a billing account from. Format: - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:body` (*type:* `GoogleApi.CloudBilling.V1.Model.BillingAccount.t`) -
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.CloudBilling.V1.Model.BillingAccount{}}` on success
* `{:error, info}` on failure
"""
@spec cloudbilling_organizations_billing_accounts_create(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.CloudBilling.V1.Model.BillingAccount.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def cloudbilling_organizations_billing_accounts_create(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:body => :body
}

request =
Request.new()
|> Request.method(:post)
|> Request.url("/v1/{+parent}/billingAccounts", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.CloudBilling.V1.Model.BillingAccount{}])
end

@doc """
Lists the billing accounts that the current authenticated user has permission to [view](https://cloud.google.com/billing/docs/how-to/billing-access).
## Parameters
* `connection` (*type:* `GoogleApi.CloudBilling.V1.Connection.t`) - Connection to server
* `parent` (*type:* `String.t`) - Optional. The parent resource to list billing accounts from. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `:filter` (*type:* `String.t`) - Options for how to filter the returned billing accounts. This only supports filtering for [subaccounts](https://cloud.google.com/billing/docs/concepts) under a single provided parent billing account. (for example, `master_billing_account=billingAccounts/012345-678901-ABCDEF`). Boolean algebra and other fields are not currently supported.
* `:pageSize` (*type:* `integer()`) - Requested page size. The maximum page size is 100; this is also the default.
* `:pageToken` (*type:* `String.t`) - 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.
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.CloudBilling.V1.Model.ListBillingAccountsResponse{}}` on success
* `{:error, info}` on failure
"""
@spec cloudbilling_organizations_billing_accounts_list(
Tesla.Env.client(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.CloudBilling.V1.Model.ListBillingAccountsResponse.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def cloudbilling_organizations_billing_accounts_list(
connection,
parent,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query,
:filter => :query,
:pageSize => :query,
:pageToken => :query
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+parent}/billingAccounts", %{
"parent" => URI.encode(parent, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(
opts ++ [struct: %GoogleApi.CloudBilling.V1.Model.ListBillingAccountsResponse{}]
)
end

@doc """
Changes which parent organization a billing account belongs to.
## Parameters
* `connection` (*type:* `GoogleApi.CloudBilling.V1.Connection.t`) - Connection to server
* `destination_parent` (*type:* `String.t`) - Required. The resource name of the Organization to move the billing account under. Must be of the form `organizations/{organization_id}`.
* `name` (*type:* `String.t`) - Required. The resource name of the billing account to move. Must be of the form `billingAccounts/{billing_account_id}`. The specified billing account cannot be a subaccount, since a subaccount always belongs to the same organization as its parent account.
* `optional_params` (*type:* `keyword()`) - Optional parameters
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
* `:access_token` (*type:* `String.t`) - OAuth access token.
* `:alt` (*type:* `String.t`) - Data format for response.
* `:callback` (*type:* `String.t`) - JSONP
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
* `:key` (*type:* `String.t`) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
* `:quotaUser` (*type:* `String.t`) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
* `opts` (*type:* `keyword()`) - Call options
## Returns
* `{:ok, %GoogleApi.CloudBilling.V1.Model.BillingAccount{}}` on success
* `{:error, info}` on failure
"""
@spec cloudbilling_organizations_billing_accounts_move(
Tesla.Env.client(),
String.t(),
String.t(),
keyword(),
keyword()
) ::
{:ok, GoogleApi.CloudBilling.V1.Model.BillingAccount.t()}
| {:ok, Tesla.Env.t()}
| {:ok, list()}
| {:error, any()}
def cloudbilling_organizations_billing_accounts_move(
connection,
destination_parent,
name,
optional_params \\ [],
opts \\ []
) do
optional_params_config = %{
:"$.xgafv" => :query,
:access_token => :query,
:alt => :query,
:callback => :query,
:fields => :query,
:key => :query,
:oauth_token => :query,
:prettyPrint => :query,
:quotaUser => :query,
:uploadType => :query,
:upload_protocol => :query
}

request =
Request.new()
|> Request.method(:get)
|> Request.url("/v1/{+destinationParent}/{+name}:move", %{
"destinationParent" => URI.encode(destination_parent, &URI.char_unreserved?/1),
"name" => URI.encode(name, &URI.char_unreserved?/1)
})
|> Request.add_optional_params(optional_params_config, optional_params)
|> Request.library_version(@library_version)

connection
|> Connection.execute(request)
|> Response.decode(opts ++ [struct: %GoogleApi.CloudBilling.V1.Model.BillingAccount{}])
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ defmodule GoogleApi.CloudBilling.V1 do
API client metadata for GoogleApi.CloudBilling.V1.
"""

@discovery_revision "20220908"
@discovery_revision "20240301"

def discovery_revision(), do: @discovery_revision
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ defmodule GoogleApi.CloudBilling.V1.Model.BillingAccount do
* `displayName` (*type:* `String.t`, *default:* `nil`) - The display name given to the billing account, such as `My Billing Account`. This name is displayed in the Google Cloud Console.
* `masterBillingAccount` (*type:* `String.t`, *default:* `nil`) - If this account is a [subaccount](https://cloud.google.com/billing/docs/concepts), then this will be the resource name of the parent billing account that it is being resold through. Otherwise this will be empty.
* `name` (*type:* `String.t`, *default:* `nil`) - Output only. 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`.
* `open` (*type:* `boolean()`, *default:* `nil`) - Output only. 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` (*type:* `boolean()`, *default:* `nil`) - Output only. 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 are unable to use paid services.
* `parent` (*type:* `String.t`, *default:* `nil`) - Output only. The billing account's parent resource identifier. Use the `MoveBillingAccount` method to update the account's parent resource if it is a organization. Format: - `organizations/{organization_id}`, for example, `organizations/12345678` - `billingAccounts/{billing_account_id}`, for example, `billingAccounts/012345-567890-ABCDEF`
"""

use GoogleApi.Gax.ModelBase
Expand All @@ -33,13 +34,15 @@ defmodule GoogleApi.CloudBilling.V1.Model.BillingAccount do
:displayName => String.t() | nil,
:masterBillingAccount => String.t() | nil,
:name => String.t() | nil,
:open => boolean() | nil
:open => boolean() | nil,
:parent => String.t() | nil
}

field(:displayName)
field(:masterBillingAccount)
field(:name)
field(:open)
field(:parent)
end

defimpl Poison.Decoder, for: GoogleApi.CloudBilling.V1.Model.BillingAccount do
Expand Down
Loading

0 comments on commit dd9b799

Please sign in to comment.