diff --git a/packages/google-cloud-billing/google/cloud/billing/gapic_version.py b/packages/google-cloud-billing/google/cloud/billing/gapic_version.py index 6f9b28f95196..405b1cebcf15 100644 --- a/packages/google-cloud-billing/google/cloud/billing/gapic_version.py +++ b/packages/google-cloud-billing/google/cloud/billing/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.10.1" # {x-release-please-version} +__version__ = "0.1.0" # {x-release-please-version} diff --git a/packages/google-cloud-billing/google/cloud/billing_v1/gapic_version.py b/packages/google-cloud-billing/google/cloud/billing_v1/gapic_version.py index 6f9b28f95196..405b1cebcf15 100644 --- a/packages/google-cloud-billing/google/cloud/billing_v1/gapic_version.py +++ b/packages/google-cloud-billing/google/cloud/billing_v1/gapic_version.py @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. # -__version__ = "1.10.1" # {x-release-please-version} +__version__ = "0.1.0" # {x-release-please-version} diff --git a/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/async_client.py b/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/async_client.py index 859d9c69f91c..d97105625bdc 100644 --- a/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/async_client.py +++ b/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/async_client.py @@ -63,6 +63,12 @@ class CloudBillingAsyncClient: DEFAULT_ENDPOINT = CloudBillingClient.DEFAULT_ENDPOINT DEFAULT_MTLS_ENDPOINT = CloudBillingClient.DEFAULT_MTLS_ENDPOINT + project_billing_info_path = staticmethod( + CloudBillingClient.project_billing_info_path + ) + parse_project_billing_info_path = staticmethod( + CloudBillingClient.parse_project_billing_info_path + ) common_billing_account_path = staticmethod( CloudBillingClient.common_billing_account_path ) diff --git a/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/client.py b/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/client.py index 703148adc13a..799c7f2ba67d 100644 --- a/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/client.py +++ b/packages/google-cloud-billing/google/cloud/billing_v1/services/cloud_billing/client.py @@ -180,6 +180,21 @@ def transport(self) -> CloudBillingTransport: """ return self._transport + @staticmethod + def project_billing_info_path( + project: str, + ) -> str: + """Returns a fully-qualified project_billing_info string.""" + return "projects/{project}/billingInfo".format( + project=project, + ) + + @staticmethod + def parse_project_billing_info_path(path: str) -> Dict[str, str]: + """Parses a project_billing_info path into its component segments.""" + m = re.match(r"^projects/(?P.+?)/billingInfo$", path) + return m.groupdict() if m else {} + @staticmethod def common_billing_account_path( billing_account: str, diff --git a/packages/google-cloud-billing/google/cloud/billing_v1/types/cloud_billing.py b/packages/google-cloud-billing/google/cloud/billing_v1/types/cloud_billing.py index cb3f2ca65458..9c1770135931 100644 --- a/packages/google-cloud-billing/google/cloud/billing_v1/types/cloud_billing.py +++ b/packages/google-cloud-billing/google/cloud/billing_v1/types/cloud_billing.py @@ -95,29 +95,31 @@ class ProjectBillingInfo(proto.Message): Attributes: name (str): - The resource name for the ``ProjectBillingInfo``; has the - form ``projects/{project_id}/billingInfo``. For example, the + Output only. 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. project_id (str): - 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. + Output only. 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. billing_account_name (str): The resource name of the billing account associated with the project, if any. For example, ``billingAccounts/012345-567890-ABCDEF``. billing_enabled (bool): - 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. + Output only. 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. """ name: str = proto.Field( diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_create_billing_account_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_create_billing_account_async.py new file mode 100644 index 000000000000..07d988125cb3 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_create_billing_account_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateBillingAccount +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_create_billing_account(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.CreateBillingAccountRequest( + ) + + # Make the request + response = await client.create_billing_account(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_create_billing_account_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_create_billing_account_sync.py new file mode 100644 index 000000000000..f077b15d4915 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_create_billing_account_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateBillingAccount +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_create_billing_account(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.CreateBillingAccountRequest( + ) + + # Make the request + response = client.create_billing_account(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_billing_account_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_billing_account_async.py new file mode 100644 index 000000000000..103bd0db83a1 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_billing_account_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetBillingAccount +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_GetBillingAccount_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_get_billing_account(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.GetBillingAccountRequest( + name="name_value", + ) + + # Make the request + response = await client.get_billing_account(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_GetBillingAccount_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_billing_account_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_billing_account_sync.py new file mode 100644 index 000000000000..161219c852c3 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_billing_account_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetBillingAccount +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_GetBillingAccount_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_get_billing_account(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.GetBillingAccountRequest( + name="name_value", + ) + + # Make the request + response = client.get_billing_account(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_GetBillingAccount_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_iam_policy_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_iam_policy_async.py new file mode 100644 index 000000000000..3ca759d7ffb0 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_iam_policy_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_GetIamPolicy_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_get_iam_policy(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_GetIamPolicy_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_iam_policy_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_iam_policy_sync.py new file mode 100644 index 000000000000..925b8e2de211 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_GetIamPolicy_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_get_iam_policy(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_GetIamPolicy_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_project_billing_info_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_project_billing_info_async.py new file mode 100644 index 000000000000..03df6579037f --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_project_billing_info_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetProjectBillingInfo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_get_project_billing_info(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.GetProjectBillingInfoRequest( + name="name_value", + ) + + # Make the request + response = await client.get_project_billing_info(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_project_billing_info_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_project_billing_info_sync.py new file mode 100644 index 000000000000..e0b1cd9a4216 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_get_project_billing_info_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetProjectBillingInfo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_get_project_billing_info(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.GetProjectBillingInfoRequest( + name="name_value", + ) + + # Make the request + response = client.get_project_billing_info(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_billing_accounts_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_billing_accounts_async.py new file mode 100644 index 000000000000..ef0f2f5fdfa4 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_billing_accounts_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListBillingAccounts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_list_billing_accounts(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.ListBillingAccountsRequest( + ) + + # Make the request + page_result = client.list_billing_accounts(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_billing_accounts_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_billing_accounts_sync.py new file mode 100644 index 000000000000..92ed39ab8444 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_billing_accounts_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListBillingAccounts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_list_billing_accounts(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.ListBillingAccountsRequest( + ) + + # Make the request + page_result = client.list_billing_accounts(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_project_billing_info_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_project_billing_info_async.py new file mode 100644 index 000000000000..b692c04ca3c8 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_project_billing_info_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListProjectBillingInfo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_list_project_billing_info(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.ListProjectBillingInfoRequest( + name="name_value", + ) + + # Make the request + page_result = client.list_project_billing_info(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_project_billing_info_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_project_billing_info_sync.py new file mode 100644 index 000000000000..82e8fd3a0df7 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_list_project_billing_info_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListProjectBillingInfo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_list_project_billing_info(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.ListProjectBillingInfoRequest( + name="name_value", + ) + + # Make the request + page_result = client.list_project_billing_info(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_set_iam_policy_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_set_iam_policy_async.py new file mode 100644 index 000000000000..eacaed6099e9 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_set_iam_policy_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_SetIamPolicy_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_set_iam_policy(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_SetIamPolicy_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_set_iam_policy_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_set_iam_policy_sync.py new file mode 100644 index 000000000000..f30a28649865 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_set_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_SetIamPolicy_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_set_iam_policy(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_SetIamPolicy_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_test_iam_permissions_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_test_iam_permissions_async.py new file mode 100644 index 000000000000..257d37bc6509 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_test_iam_permissions_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_TestIamPermissions_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_test_iam_permissions(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_TestIamPermissions_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_test_iam_permissions_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_test_iam_permissions_sync.py new file mode 100644 index 000000000000..c685e45248dc --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_test_iam_permissions_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_TestIamPermissions_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_test_iam_permissions(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_TestIamPermissions_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_billing_account_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_billing_account_async.py new file mode 100644 index 000000000000..ba3953e6adfc --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_billing_account_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateBillingAccount +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_update_billing_account(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.UpdateBillingAccountRequest( + name="name_value", + ) + + # Make the request + response = await client.update_billing_account(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_billing_account_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_billing_account_sync.py new file mode 100644 index 000000000000..873d1904a4ca --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_billing_account_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateBillingAccount +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_update_billing_account(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.UpdateBillingAccountRequest( + name="name_value", + ) + + # Make the request + response = client.update_billing_account(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_project_billing_info_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_project_billing_info_async.py new file mode 100644 index 000000000000..7ff0e87c93c5 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_project_billing_info_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateProjectBillingInfo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_update_project_billing_info(): + # Create a client + client = billing_v1.CloudBillingAsyncClient() + + # Initialize request argument(s) + request = billing_v1.UpdateProjectBillingInfoRequest( + name="name_value", + ) + + # Make the request + response = await client.update_project_billing_info(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_project_billing_info_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_project_billing_info_sync.py new file mode 100644 index 000000000000..78b8cbd19c59 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_billing_update_project_billing_info_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateProjectBillingInfo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_update_project_billing_info(): + # Create a client + client = billing_v1.CloudBillingClient() + + # Initialize request argument(s) + request = billing_v1.UpdateProjectBillingInfoRequest( + name="name_value", + ) + + # Make the request + response = client.update_project_billing_info(request=request) + + # Handle the response + print(response) + +# [END cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_services_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_services_async.py new file mode 100644 index 000000000000..22259be8497b --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_services_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListServices +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudCatalog_ListServices_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_list_services(): + # Create a client + client = billing_v1.CloudCatalogAsyncClient() + + # Initialize request argument(s) + request = billing_v1.ListServicesRequest( + ) + + # Make the request + page_result = client.list_services(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudCatalog_ListServices_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_services_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_services_sync.py new file mode 100644 index 000000000000..3b482cba3996 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_services_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListServices +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudCatalog_ListServices_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_list_services(): + # Create a client + client = billing_v1.CloudCatalogClient() + + # Initialize request argument(s) + request = billing_v1.ListServicesRequest( + ) + + # Make the request + page_result = client.list_services(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudCatalog_ListServices_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_skus_async.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_skus_async.py new file mode 100644 index 000000000000..2a8089fde307 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_skus_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudCatalog_ListSkus_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +async def sample_list_skus(): + # Create a client + client = billing_v1.CloudCatalogAsyncClient() + + # Initialize request argument(s) + request = billing_v1.ListSkusRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_skus(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudCatalog_ListSkus_async] diff --git a/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_skus_sync.py b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_skus_sync.py new file mode 100644 index 000000000000..49fe647a6dcd --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/cloudbilling_v1_generated_cloud_catalog_list_skus_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-billing + + +# [START cloudbilling_v1_generated_CloudCatalog_ListSkus_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import billing_v1 + + +def sample_list_skus(): + # Create a client + client = billing_v1.CloudCatalogClient() + + # Initialize request argument(s) + request = billing_v1.ListSkusRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudbilling_v1_generated_CloudCatalog_ListSkus_sync] diff --git a/packages/google-cloud-billing/samples/generated_samples/snippet_metadata_google.cloud.billing.v1.json b/packages/google-cloud-billing/samples/generated_samples/snippet_metadata_google.cloud.billing.v1.json new file mode 100644 index 000000000000..baa168288190 --- /dev/null +++ b/packages/google-cloud-billing/samples/generated_samples/snippet_metadata_google.cloud.billing.v1.json @@ -0,0 +1,1955 @@ +{ + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.billing.v1", + "version": "v1" + } + ], + "language": "PYTHON", + "name": "google-cloud-billing", + "version": "0.1.0" + }, + "snippets": [ + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.create_billing_account", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.CreateBillingAccount", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "CreateBillingAccount" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.CreateBillingAccountRequest" + }, + { + "name": "billing_account", + "type": "google.cloud.billing_v1.types.BillingAccount" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.BillingAccount", + "shortName": "create_billing_account" + }, + "description": "Sample for CreateBillingAccount", + "file": "cloudbilling_v1_generated_cloud_billing_create_billing_account_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_create_billing_account_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.create_billing_account", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.CreateBillingAccount", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "CreateBillingAccount" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.CreateBillingAccountRequest" + }, + { + "name": "billing_account", + "type": "google.cloud.billing_v1.types.BillingAccount" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.BillingAccount", + "shortName": "create_billing_account" + }, + "description": "Sample for CreateBillingAccount", + "file": "cloudbilling_v1_generated_cloud_billing_create_billing_account_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_CreateBillingAccount_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_create_billing_account_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.get_billing_account", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.GetBillingAccount", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "GetBillingAccount" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.GetBillingAccountRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.BillingAccount", + "shortName": "get_billing_account" + }, + "description": "Sample for GetBillingAccount", + "file": "cloudbilling_v1_generated_cloud_billing_get_billing_account_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_GetBillingAccount_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_get_billing_account_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.get_billing_account", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.GetBillingAccount", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "GetBillingAccount" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.GetBillingAccountRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.BillingAccount", + "shortName": "get_billing_account" + }, + "description": "Sample for GetBillingAccount", + "file": "cloudbilling_v1_generated_cloud_billing_get_billing_account_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_GetBillingAccount_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_get_billing_account_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.get_iam_policy", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.GetIamPolicy", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "cloudbilling_v1_generated_cloud_billing_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_GetIamPolicy_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_get_iam_policy_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.get_iam_policy", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.GetIamPolicy", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "cloudbilling_v1_generated_cloud_billing_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_GetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_get_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.get_project_billing_info", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.GetProjectBillingInfo", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "GetProjectBillingInfo" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.GetProjectBillingInfoRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.ProjectBillingInfo", + "shortName": "get_project_billing_info" + }, + "description": "Sample for GetProjectBillingInfo", + "file": "cloudbilling_v1_generated_cloud_billing_get_project_billing_info_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_get_project_billing_info_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.get_project_billing_info", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.GetProjectBillingInfo", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "GetProjectBillingInfo" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.GetProjectBillingInfoRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.ProjectBillingInfo", + "shortName": "get_project_billing_info" + }, + "description": "Sample for GetProjectBillingInfo", + "file": "cloudbilling_v1_generated_cloud_billing_get_project_billing_info_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_GetProjectBillingInfo_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_get_project_billing_info_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.list_billing_accounts", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.ListBillingAccounts", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "ListBillingAccounts" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListBillingAccountsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_billing.pagers.ListBillingAccountsAsyncPager", + "shortName": "list_billing_accounts" + }, + "description": "Sample for ListBillingAccounts", + "file": "cloudbilling_v1_generated_cloud_billing_list_billing_accounts_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_list_billing_accounts_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.list_billing_accounts", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.ListBillingAccounts", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "ListBillingAccounts" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListBillingAccountsRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_billing.pagers.ListBillingAccountsPager", + "shortName": "list_billing_accounts" + }, + "description": "Sample for ListBillingAccounts", + "file": "cloudbilling_v1_generated_cloud_billing_list_billing_accounts_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_ListBillingAccounts_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_list_billing_accounts_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.list_project_billing_info", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.ListProjectBillingInfo", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "ListProjectBillingInfo" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListProjectBillingInfoRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_billing.pagers.ListProjectBillingInfoAsyncPager", + "shortName": "list_project_billing_info" + }, + "description": "Sample for ListProjectBillingInfo", + "file": "cloudbilling_v1_generated_cloud_billing_list_project_billing_info_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_list_project_billing_info_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.list_project_billing_info", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.ListProjectBillingInfo", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "ListProjectBillingInfo" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListProjectBillingInfoRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_billing.pagers.ListProjectBillingInfoPager", + "shortName": "list_project_billing_info" + }, + "description": "Sample for ListProjectBillingInfo", + "file": "cloudbilling_v1_generated_cloud_billing_list_project_billing_info_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_ListProjectBillingInfo_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_list_project_billing_info_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.set_iam_policy", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.SetIamPolicy", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "cloudbilling_v1_generated_cloud_billing_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_SetIamPolicy_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_set_iam_policy_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.set_iam_policy", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.SetIamPolicy", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "cloudbilling_v1_generated_cloud_billing_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_SetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_set_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.test_iam_permissions", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.TestIamPermissions", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "MutableSequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "cloudbilling_v1_generated_cloud_billing_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_TestIamPermissions_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_test_iam_permissions_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.test_iam_permissions", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.TestIamPermissions", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "MutableSequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "cloudbilling_v1_generated_cloud_billing_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_TestIamPermissions_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_test_iam_permissions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.update_billing_account", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.UpdateBillingAccount", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "UpdateBillingAccount" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.UpdateBillingAccountRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "account", + "type": "google.cloud.billing_v1.types.BillingAccount" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.BillingAccount", + "shortName": "update_billing_account" + }, + "description": "Sample for UpdateBillingAccount", + "file": "cloudbilling_v1_generated_cloud_billing_update_billing_account_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_update_billing_account_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.update_billing_account", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.UpdateBillingAccount", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "UpdateBillingAccount" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.UpdateBillingAccountRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "account", + "type": "google.cloud.billing_v1.types.BillingAccount" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.BillingAccount", + "shortName": "update_billing_account" + }, + "description": "Sample for UpdateBillingAccount", + "file": "cloudbilling_v1_generated_cloud_billing_update_billing_account_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_UpdateBillingAccount_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_update_billing_account_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient", + "shortName": "CloudBillingAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingAsyncClient.update_project_billing_info", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.UpdateProjectBillingInfo", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "UpdateProjectBillingInfo" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.UpdateProjectBillingInfoRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "project_billing_info", + "type": "google.cloud.billing_v1.types.ProjectBillingInfo" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.ProjectBillingInfo", + "shortName": "update_project_billing_info" + }, + "description": "Sample for UpdateProjectBillingInfo", + "file": "cloudbilling_v1_generated_cloud_billing_update_project_billing_info_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_update_project_billing_info_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudBillingClient", + "shortName": "CloudBillingClient" + }, + "fullName": "google.cloud.billing_v1.CloudBillingClient.update_project_billing_info", + "method": { + "fullName": "google.cloud.billing.v1.CloudBilling.UpdateProjectBillingInfo", + "service": { + "fullName": "google.cloud.billing.v1.CloudBilling", + "shortName": "CloudBilling" + }, + "shortName": "UpdateProjectBillingInfo" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.UpdateProjectBillingInfoRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "project_billing_info", + "type": "google.cloud.billing_v1.types.ProjectBillingInfo" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.types.ProjectBillingInfo", + "shortName": "update_project_billing_info" + }, + "description": "Sample for UpdateProjectBillingInfo", + "file": "cloudbilling_v1_generated_cloud_billing_update_project_billing_info_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudBilling_UpdateProjectBillingInfo_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_billing_update_project_billing_info_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudCatalogAsyncClient", + "shortName": "CloudCatalogAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudCatalogAsyncClient.list_services", + "method": { + "fullName": "google.cloud.billing.v1.CloudCatalog.ListServices", + "service": { + "fullName": "google.cloud.billing.v1.CloudCatalog", + "shortName": "CloudCatalog" + }, + "shortName": "ListServices" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListServicesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_catalog.pagers.ListServicesAsyncPager", + "shortName": "list_services" + }, + "description": "Sample for ListServices", + "file": "cloudbilling_v1_generated_cloud_catalog_list_services_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudCatalog_ListServices_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_catalog_list_services_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudCatalogClient", + "shortName": "CloudCatalogClient" + }, + "fullName": "google.cloud.billing_v1.CloudCatalogClient.list_services", + "method": { + "fullName": "google.cloud.billing.v1.CloudCatalog.ListServices", + "service": { + "fullName": "google.cloud.billing.v1.CloudCatalog", + "shortName": "CloudCatalog" + }, + "shortName": "ListServices" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListServicesRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_catalog.pagers.ListServicesPager", + "shortName": "list_services" + }, + "description": "Sample for ListServices", + "file": "cloudbilling_v1_generated_cloud_catalog_list_services_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudCatalog_ListServices_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_catalog_list_services_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.billing_v1.CloudCatalogAsyncClient", + "shortName": "CloudCatalogAsyncClient" + }, + "fullName": "google.cloud.billing_v1.CloudCatalogAsyncClient.list_skus", + "method": { + "fullName": "google.cloud.billing.v1.CloudCatalog.ListSkus", + "service": { + "fullName": "google.cloud.billing.v1.CloudCatalog", + "shortName": "CloudCatalog" + }, + "shortName": "ListSkus" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListSkusRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_catalog.pagers.ListSkusAsyncPager", + "shortName": "list_skus" + }, + "description": "Sample for ListSkus", + "file": "cloudbilling_v1_generated_cloud_catalog_list_skus_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudCatalog_ListSkus_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_catalog_list_skus_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.billing_v1.CloudCatalogClient", + "shortName": "CloudCatalogClient" + }, + "fullName": "google.cloud.billing_v1.CloudCatalogClient.list_skus", + "method": { + "fullName": "google.cloud.billing.v1.CloudCatalog.ListSkus", + "service": { + "fullName": "google.cloud.billing.v1.CloudCatalog", + "shortName": "CloudCatalog" + }, + "shortName": "ListSkus" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.billing_v1.types.ListSkusRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.billing_v1.services.cloud_catalog.pagers.ListSkusPager", + "shortName": "list_skus" + }, + "description": "Sample for ListSkus", + "file": "cloudbilling_v1_generated_cloud_catalog_list_skus_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "cloudbilling_v1_generated_CloudCatalog_ListSkus_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "cloudbilling_v1_generated_cloud_catalog_list_skus_sync.py" + } + ] +} diff --git a/packages/google-cloud-billing/tests/unit/gapic/billing_v1/test_cloud_billing.py b/packages/google-cloud-billing/tests/unit/gapic/billing_v1/test_cloud_billing.py index 773658f2b8b8..96ebccdfaf1c 100644 --- a/packages/google-cloud-billing/tests/unit/gapic/billing_v1/test_cloud_billing.py +++ b/packages/google-cloud-billing/tests/unit/gapic/billing_v1/test_cloud_billing.py @@ -6779,8 +6779,28 @@ def test_cloud_billing_transport_channel_mtls_with_adc(transport_class): assert transport.grpc_channel == mock_grpc_channel +def test_project_billing_info_path(): + project = "squid" + expected = "projects/{project}/billingInfo".format( + project=project, + ) + actual = CloudBillingClient.project_billing_info_path(project) + assert expected == actual + + +def test_parse_project_billing_info_path(): + expected = { + "project": "clam", + } + path = CloudBillingClient.project_billing_info_path(**expected) + + # Check that the path construction is reversible. + actual = CloudBillingClient.parse_project_billing_info_path(path) + assert expected == actual + + def test_common_billing_account_path(): - billing_account = "squid" + billing_account = "whelk" expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -6790,7 +6810,7 @@ def test_common_billing_account_path(): def test_parse_common_billing_account_path(): expected = { - "billing_account": "clam", + "billing_account": "octopus", } path = CloudBillingClient.common_billing_account_path(**expected) @@ -6800,7 +6820,7 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): - folder = "whelk" + folder = "oyster" expected = "folders/{folder}".format( folder=folder, ) @@ -6810,7 +6830,7 @@ def test_common_folder_path(): def test_parse_common_folder_path(): expected = { - "folder": "octopus", + "folder": "nudibranch", } path = CloudBillingClient.common_folder_path(**expected) @@ -6820,7 +6840,7 @@ def test_parse_common_folder_path(): def test_common_organization_path(): - organization = "oyster" + organization = "cuttlefish" expected = "organizations/{organization}".format( organization=organization, ) @@ -6830,7 +6850,7 @@ def test_common_organization_path(): def test_parse_common_organization_path(): expected = { - "organization": "nudibranch", + "organization": "mussel", } path = CloudBillingClient.common_organization_path(**expected) @@ -6840,7 +6860,7 @@ def test_parse_common_organization_path(): def test_common_project_path(): - project = "cuttlefish" + project = "winkle" expected = "projects/{project}".format( project=project, ) @@ -6850,7 +6870,7 @@ def test_common_project_path(): def test_parse_common_project_path(): expected = { - "project": "mussel", + "project": "nautilus", } path = CloudBillingClient.common_project_path(**expected) @@ -6860,8 +6880,8 @@ def test_parse_common_project_path(): def test_common_location_path(): - project = "winkle" - location = "nautilus" + project = "scallop" + location = "abalone" expected = "projects/{project}/locations/{location}".format( project=project, location=location, @@ -6872,8 +6892,8 @@ def test_common_location_path(): def test_parse_common_location_path(): expected = { - "project": "scallop", - "location": "abalone", + "project": "squid", + "location": "clam", } path = CloudBillingClient.common_location_path(**expected)