Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
chore: Update gapic-generator-python to v1.6.1 (#247)
Browse files Browse the repository at this point in the history
* chore: update to gapic-generator-python 1.5.0

feat: add support for `google.cloud.<api>.__version__`
PiperOrigin-RevId: 484665853

Source-Link: googleapis/googleapis@8eb249a

Source-Link: googleapis/googleapis-gen@c8aa327
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* update version in gapic_version.py

* add .release-please-manifest.json with correct version

* add owlbot.py to exclude generated gapic_version.py

* set manifest to true in .github/release-please.yml

* add release-please-config.json

* chore: Update to gapic-generator-python 1.6.0

feat(python): Add typing to proto.Message based class attributes

feat(python): Snippetgen handling of repeated enum field

PiperOrigin-RevId: 487326846

Source-Link: googleapis/googleapis@da380c7

Source-Link: googleapis/googleapis-gen@61ef576
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* feat: new APIs added to reflect updates to the filestore service

- Add ENTERPRISE Tier
- Add snapshot APIs: RevertInstance, ListSnapshots, CreateSnapshot, DeleteSnapshot, UpdateSnapshot
- Add multi-share APIs: ListShares, GetShare, CreateShare, DeleteShare, UpdateShare
- Add ConnectMode to NetworkConfig (for Private Service Access support)
- New status codes (SUSPENDED/SUSPENDING, REVERTING/RESUMING)
- Add SuspensionReason (for KMS related suspension)
- Add new fields to Instance information: max_capacity_gb, capacity_step_size_gb, max_share_count, capacity_gb, multi_share_enabled

PiperOrigin-RevId: 487492758

Source-Link: googleapis/googleapis@5be5981

Source-Link: googleapis/googleapis-gen@ab0e217
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWIwZTIxN2Y1NjBjYzJjMWFmYzExNDQxYzJlYWI2YjY5NTBlZmQyYiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* update path to snippet metadata json

* chore: Update gapic-generator-python to v1.6.1

PiperOrigin-RevId: 488036204

Source-Link: googleapis/googleapis@08f275f

Source-Link: googleapis/googleapis-gen@555c094
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* fix url in setup.py

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
3 people committed Nov 21, 2022
1 parent 5f6721c commit 058966c
Show file tree
Hide file tree
Showing 32 changed files with 438 additions and 231 deletions.
1 change: 1 addition & 0 deletions .github/release-please.yml
@@ -1,5 +1,6 @@
releaseType: python
handleGHRelease: true
manifest: true
# NOTE: this section is generated by synthtool.languages.python
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
branches:
Expand Down
3 changes: 3 additions & 0 deletions .release-please-manifest.json
@@ -0,0 +1,3 @@
{
".": "1.7.3"
}
1 change: 0 additions & 1 deletion docs/budgets_v1/types.rst
Expand Up @@ -3,5 +3,4 @@ Types for Google Cloud Billing Budgets v1 API

.. automodule:: google.cloud.billing.budgets_v1.types
:members:
:undoc-members:
:show-inheritance:
1 change: 0 additions & 1 deletion docs/budgets_v1beta1/types.rst
Expand Up @@ -3,5 +3,4 @@ Types for Google Cloud Billing Budgets v1beta1 API

.. automodule:: google.cloud.billing.budgets_v1beta1.types
:members:
:undoc-members:
:show-inheritance:
4 changes: 4 additions & 0 deletions google/cloud/billing/budgets/__init__.py
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.billing.budgets import gapic_version as package_version

__version__ = package_version.__version__


from google.cloud.billing.budgets_v1.services.budget_service.async_client import (
BudgetServiceAsyncClient,
Expand Down
16 changes: 16 additions & 0 deletions google/cloud/billing/budgets/gapic_version.py
@@ -0,0 +1,16 @@
# -*- 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.
#
__version__ = "1.7.3" # {x-release-please-version}
4 changes: 4 additions & 0 deletions google/cloud/billing/budgets_v1/__init__.py
Expand Up @@ -13,6 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
from google.cloud.billing.budgets import gapic_version as package_version

__version__ = package_version.__version__


from .services.budget_service import BudgetServiceAsyncClient, BudgetServiceClient
from .types.budget_model import (
Expand Down
Expand Up @@ -16,7 +16,17 @@
from collections import OrderedDict
import functools
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
)

from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
Expand Down Expand Up @@ -164,9 +174,9 @@ def transport(self) -> BudgetServiceTransport:
def __init__(
self,
*,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, BudgetServiceTransport] = "grpc_asyncio",
client_options: ClientOptions = None,
client_options: Optional[ClientOptions] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the budget service client.
Expand Down Expand Up @@ -210,12 +220,12 @@ def __init__(

async def create_budget(
self,
request: Union[budget_service.CreateBudgetRequest, dict] = None,
request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None,
*,
parent: str = None,
budget: budget_model.Budget = None,
parent: Optional[str] = None,
budget: Optional[budget_model.Budget] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> budget_model.Budget:
r"""Creates a new budget. See `Quotas and
Expand Down Expand Up @@ -250,7 +260,7 @@ async def sample_create_budget():
print(response)
Args:
request (Union[google.cloud.billing.budgets_v1.types.CreateBudgetRequest, dict]):
request (Optional[Union[google.cloud.billing.budgets_v1.types.CreateBudgetRequest, dict]]):
The request object. Request for CreateBudget
parent (:class:`str`):
Required. The name of the billing account to create the
Expand Down Expand Up @@ -330,12 +340,12 @@ async def sample_create_budget():

async def update_budget(
self,
request: Union[budget_service.UpdateBudgetRequest, dict] = None,
request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None,
*,
budget: budget_model.Budget = None,
update_mask: field_mask_pb2.FieldMask = None,
budget: Optional[budget_model.Budget] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> budget_model.Budget:
r"""Updates a budget and returns the updated budget.
Expand Down Expand Up @@ -370,7 +380,7 @@ async def sample_update_budget():
print(response)
Args:
request (Union[google.cloud.billing.budgets_v1.types.UpdateBudgetRequest, dict]):
request (Optional[Union[google.cloud.billing.budgets_v1.types.UpdateBudgetRequest, dict]]):
The request object. Request for UpdateBudget
budget (:class:`google.cloud.billing.budgets_v1.types.Budget`):
Required. The updated budget object.
Expand Down Expand Up @@ -468,11 +478,11 @@ async def sample_update_budget():

async def get_budget(
self,
request: Union[budget_service.GetBudgetRequest, dict] = None,
request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None,
*,
name: str = None,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> budget_model.Budget:
r"""Returns a budget.
Expand Down Expand Up @@ -509,7 +519,7 @@ async def sample_get_budget():
print(response)
Args:
request (Union[google.cloud.billing.budgets_v1.types.GetBudgetRequest, dict]):
request (Optional[Union[google.cloud.billing.budgets_v1.types.GetBudgetRequest, dict]]):
The request object. Request for GetBudget
name (:class:`str`):
Required. Name of budget to get. Values are of the form
Expand Down Expand Up @@ -591,11 +601,11 @@ async def sample_get_budget():

async def list_budgets(
self,
request: Union[budget_service.ListBudgetsRequest, dict] = None,
request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None,
*,
parent: str = None,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListBudgetsAsyncPager:
r"""Returns a list of budgets for a billing account.
Expand Down Expand Up @@ -633,7 +643,7 @@ async def sample_list_budgets():
print(response)
Args:
request (Union[google.cloud.billing.budgets_v1.types.ListBudgetsRequest, dict]):
request (Optional[Union[google.cloud.billing.budgets_v1.types.ListBudgetsRequest, dict]]):
The request object. Request for ListBudgets
parent (:class:`str`):
Required. Name of billing account to list budgets under.
Expand Down Expand Up @@ -720,11 +730,11 @@ async def sample_list_budgets():

async def delete_budget(
self,
request: Union[budget_service.DeleteBudgetRequest, dict] = None,
request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None,
*,
name: str = None,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a budget. Returns successfully if already
Expand Down Expand Up @@ -754,7 +764,7 @@ async def sample_delete_budget():
await client.delete_budget(request=request)
Args:
request (Union[google.cloud.billing.budgets_v1.types.DeleteBudgetRequest, dict]):
request (Optional[Union[google.cloud.billing.budgets_v1.types.DeleteBudgetRequest, dict]]):
The request object. Request for DeleteBudget
name (:class:`str`):
Required. Name of the budget to delete. Values are of
Expand Down
56 changes: 34 additions & 22 deletions google/cloud/billing/budgets_v1/services/budget_service/client.py
Expand Up @@ -16,7 +16,18 @@
from collections import OrderedDict
import os
import re
from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)

from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
Expand Down Expand Up @@ -58,7 +69,7 @@ class BudgetServiceClientMeta(type):

def get_transport_class(
cls,
label: str = None,
label: Optional[str] = None,
) -> Type[BudgetServiceTransport]:
"""Returns an appropriate transport class.
Expand Down Expand Up @@ -333,8 +344,8 @@ def __init__(
self,
*,
credentials: Optional[ga_credentials.Credentials] = None,
transport: Union[str, BudgetServiceTransport, None] = None,
client_options: Optional[client_options_lib.ClientOptions] = None,
transport: Optional[Union[str, BudgetServiceTransport]] = None,
client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
) -> None:
"""Instantiates the budget service client.
Expand All @@ -348,7 +359,7 @@ def __init__(
transport (Union[str, BudgetServiceTransport]): The
transport to use. If set to None, a transport is chosen
automatically.
client_options (google.api_core.client_options.ClientOptions): Custom options for the
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): Custom options for the
client. It won't take effect if a ``transport`` instance is provided.
(1) The ``api_endpoint`` property can be used to override the
default endpoint provided by the client. GOOGLE_API_USE_MTLS_ENDPOINT
Expand Down Expand Up @@ -378,6 +389,7 @@ def __init__(
client_options = client_options_lib.from_dict(client_options)
if client_options is None:
client_options = client_options_lib.ClientOptions()
client_options = cast(client_options_lib.ClientOptions, client_options)

api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source(
client_options
Expand Down Expand Up @@ -430,12 +442,12 @@ def __init__(

def create_budget(
self,
request: Union[budget_service.CreateBudgetRequest, dict] = None,
request: Optional[Union[budget_service.CreateBudgetRequest, dict]] = None,
*,
parent: str = None,
budget: budget_model.Budget = None,
parent: Optional[str] = None,
budget: Optional[budget_model.Budget] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> budget_model.Budget:
r"""Creates a new budget. See `Quotas and
Expand Down Expand Up @@ -550,12 +562,12 @@ def sample_create_budget():

def update_budget(
self,
request: Union[budget_service.UpdateBudgetRequest, dict] = None,
request: Optional[Union[budget_service.UpdateBudgetRequest, dict]] = None,
*,
budget: budget_model.Budget = None,
update_mask: field_mask_pb2.FieldMask = None,
budget: Optional[budget_model.Budget] = None,
update_mask: Optional[field_mask_pb2.FieldMask] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> budget_model.Budget:
r"""Updates a budget and returns the updated budget.
Expand Down Expand Up @@ -678,11 +690,11 @@ def sample_update_budget():

def get_budget(
self,
request: Union[budget_service.GetBudgetRequest, dict] = None,
request: Optional[Union[budget_service.GetBudgetRequest, dict]] = None,
*,
name: str = None,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> budget_model.Budget:
r"""Returns a budget.
Expand Down Expand Up @@ -791,11 +803,11 @@ def sample_get_budget():

def list_budgets(
self,
request: Union[budget_service.ListBudgetsRequest, dict] = None,
request: Optional[Union[budget_service.ListBudgetsRequest, dict]] = None,
*,
parent: str = None,
parent: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> pagers.ListBudgetsPager:
r"""Returns a list of budgets for a billing account.
Expand Down Expand Up @@ -910,11 +922,11 @@ def sample_list_budgets():

def delete_budget(
self,
request: Union[budget_service.DeleteBudgetRequest, dict] = None,
request: Optional[Union[budget_service.DeleteBudgetRequest, dict]] = None,
*,
name: str = None,
name: Optional[str] = None,
retry: OptionalRetry = gapic_v1.method.DEFAULT,
timeout: float = None,
timeout: Optional[float] = None,
metadata: Sequence[Tuple[str, str]] = (),
) -> None:
r"""Deletes a budget. Returns successfully if already
Expand Down
Expand Up @@ -52,7 +52,7 @@ def __init__(
self,
*,
host: str = DEFAULT_HOST,
credentials: ga_credentials.Credentials = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
Expand Down
Expand Up @@ -49,14 +49,14 @@ def __init__(
self,
*,
host: str = "billingbudgets.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
scopes: Sequence[str] = None,
channel: grpc.Channel = None,
api_mtls_endpoint: str = None,
client_cert_source: Callable[[], Tuple[bytes, bytes]] = None,
ssl_channel_credentials: grpc.ChannelCredentials = None,
client_cert_source_for_mtls: Callable[[], Tuple[bytes, bytes]] = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
channel: Optional[grpc.Channel] = None,
api_mtls_endpoint: Optional[str] = None,
client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
quota_project_id: Optional[str] = None,
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
always_use_jwt_access: Optional[bool] = False,
Expand Down Expand Up @@ -183,8 +183,8 @@ def __init__(
def create_channel(
cls,
host: str = "billingbudgets.googleapis.com",
credentials: ga_credentials.Credentials = None,
credentials_file: str = None,
credentials: Optional[ga_credentials.Credentials] = None,
credentials_file: Optional[str] = None,
scopes: Optional[Sequence[str]] = None,
quota_project_id: Optional[str] = None,
**kwargs,
Expand Down

0 comments on commit 058966c

Please sign in to comment.