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

Commit

Permalink
chore: use gapic-generator-python 0.56.2 (#120)
Browse files Browse the repository at this point in the history
* chore: update Java and Python dependencies

PiperOrigin-RevId: 408420890

Source-Link: googleapis/googleapis@2921f9f

Source-Link: googleapis/googleapis-gen@6598ca8
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjU5OGNhOGNiYmY1MjI2NzMzYTA5OWM0NTA2NTE4YTVhZjZmZjc0YyJ9

* 🦉 Updates from OwlBot

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

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Nov 9, 2021
1 parent df22360 commit 203bfbb
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 28 deletions.
Expand Up @@ -19,14 +19,17 @@
from typing import Dict, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core.client_options import ClientOptions # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core.client_options import ClientOptions
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down
25 changes: 17 additions & 8 deletions google/cloud/channel_v1/services/cloud_channel_service/client.py
Expand Up @@ -14,23 +14,25 @@
# limitations under the License.
#
from collections import OrderedDict
from distutils import util
import os
import re
from typing import Dict, Optional, Sequence, Tuple, Type, Union
import pkg_resources

from google.api_core import client_options as client_options_lib # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport import mtls # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
from google.auth.exceptions import MutualTLSChannelError # type: ignore
from google.oauth2 import service_account # type: ignore

OptionalRetry = Union[retries.Retry, object]
try:
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault]
except AttributeError: # pragma: NO COVER
OptionalRetry = Union[retries.Retry, object] # type: ignore

from google.api_core import operation # type: ignore
from google.api_core import operation_async # type: ignore
Expand Down Expand Up @@ -382,8 +384,15 @@ def __init__(
client_options = client_options_lib.ClientOptions()

# Create SSL credentials for mutual TLS if needed.
use_client_cert = bool(
util.strtobool(os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false"))
if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in (
"true",
"false",
):
raise ValueError(
"Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`"
)
use_client_cert = (
os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true"
)

client_cert_source_func = None
Expand Down
Expand Up @@ -18,11 +18,11 @@
import pkg_resources

import google.auth # type: ignore
import google.api_core # type: ignore
from google.api_core import exceptions as core_exceptions # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import retry as retries # type: ignore
from google.api_core import operations_v1 # type: ignore
import google.api_core
from google.api_core import exceptions as core_exceptions
from google.api_core import gapic_v1
from google.api_core import retry as retries
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

Expand Down
Expand Up @@ -16,9 +16,9 @@
import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import grpc_helpers # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth # type: ignore
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore
Expand Down
Expand Up @@ -16,9 +16,9 @@
import warnings
from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union

from google.api_core import gapic_v1 # type: ignore
from google.api_core import grpc_helpers_async # type: ignore
from google.api_core import operations_v1 # type: ignore
from google.api_core import gapic_v1
from google.api_core import grpc_helpers_async
from google.api_core import operations_v1
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

Expand Down
5 changes: 5 additions & 0 deletions google/cloud/channel_v1/types/common.py
Expand Up @@ -118,18 +118,23 @@ class Value(proto.Message):
Attributes:
int64_value (int):
Represents an int64 value.
This field is a member of `oneof`_ ``kind``.
string_value (str):
Represents a string value.
This field is a member of `oneof`_ ``kind``.
double_value (float):
Represents a double value.
This field is a member of `oneof`_ ``kind``.
proto_value (google.protobuf.any_pb2.Any):
Represents an 'Any' proto value.
This field is a member of `oneof`_ ``kind``.
bool_value (bool):
Represents a boolean value.
This field is a member of `oneof`_ ``kind``.
"""

Expand Down
10 changes: 10 additions & 0 deletions google/cloud/channel_v1/types/service.py
Expand Up @@ -274,9 +274,11 @@ class ImportCustomerRequest(proto.Message):
Attributes:
domain (str):
Required. Customer domain.
This field is a member of `oneof`_ ``customer_identity``.
cloud_identity_id (str):
Required. Customer's Cloud Identity ID
This field is a member of `oneof`_ ``customer_identity``.
parent (str):
Required. The resource name of the reseller's account.
Expand Down Expand Up @@ -407,12 +409,14 @@ class ListTransferableSkusRequest(proto.Message):
Attributes:
cloud_identity_id (str):
Customer's Cloud Identity ID
This field is a member of `oneof`_ ``transferred_customer_identity``.
customer_name (str):
A reseller is required to create a customer and use the
resource name of the created customer here. Customer_name
uses the format:
accounts/{account_id}/customers/{customer_id}
This field is a member of `oneof`_ ``transferred_customer_identity``.
parent (str):
Required. The reseller account's resource name. Parent uses
Expand Down Expand Up @@ -497,10 +501,12 @@ class ListTransferableOffersRequest(proto.Message):
Attributes:
cloud_identity_id (str):
Customer's Cloud Identity ID
This field is a member of `oneof`_ ``transferred_customer_identity``.
customer_name (str):
A reseller should create a customer and use
the resource name of that customer here.
This field is a member of `oneof`_ ``transferred_customer_identity``.
parent (str):
Required. The resource name of the reseller's
Expand Down Expand Up @@ -1277,10 +1283,12 @@ class ListPurchasableSkusRequest(proto.Message):
Attributes:
create_entitlement_purchase (google.cloud.channel_v1.types.ListPurchasableSkusRequest.CreateEntitlementPurchase):
List SKUs for CreateEntitlement purchase.
This field is a member of `oneof`_ ``purchase_option``.
change_offer_purchase (google.cloud.channel_v1.types.ListPurchasableSkusRequest.ChangeOfferPurchase):
List SKUs for ChangeOffer purchase with a new
SKU.
This field is a member of `oneof`_ ``purchase_option``.
customer (str):
Required. The resource name of the customer to list SKUs
Expand Down Expand Up @@ -1400,9 +1408,11 @@ class ListPurchasableOffersRequest(proto.Message):
Attributes:
create_entitlement_purchase (google.cloud.channel_v1.types.ListPurchasableOffersRequest.CreateEntitlementPurchase):
List Offers for CreateEntitlement purchase.
This field is a member of `oneof`_ ``purchase_option``.
change_offer_purchase (google.cloud.channel_v1.types.ListPurchasableOffersRequest.ChangeOfferPurchase):
List Offers for ChangeOffer purchase.
This field is a member of `oneof`_ ``purchase_option``.
customer (str):
Required. The resource name of the customer to list Offers
Expand Down
2 changes: 2 additions & 0 deletions google/cloud/channel_v1/types/subscriber_event.py
Expand Up @@ -92,10 +92,12 @@ class SubscriberEvent(proto.Message):
customer_event (google.cloud.channel_v1.types.CustomerEvent):
Customer event send as part of Pub/Sub event
to partners.
This field is a member of `oneof`_ ``event``.
entitlement_event (google.cloud.channel_v1.types.EntitlementEvent):
Entitlement event send as part of Pub/Sub
event to partners.
This field is a member of `oneof`_ ``event``.
"""

Expand Down
16 changes: 12 additions & 4 deletions tests/unit/gapic/channel_v1/test_cloud_channel_service.py
Expand Up @@ -976,7 +976,9 @@ def test_get_customer_flattened():
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
arg = args[0].name
mock_val = "name_value"
assert arg == mock_val


def test_get_customer_flattened_error():
Expand Down Expand Up @@ -1012,7 +1014,9 @@ async def test_get_customer_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
arg = args[0].name
mock_val = "name_value"
assert arg == mock_val


@pytest.mark.asyncio
Expand Down Expand Up @@ -1649,7 +1653,9 @@ def test_delete_customer_flattened():
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
arg = args[0].name
mock_val = "name_value"
assert arg == mock_val


def test_delete_customer_flattened_error():
Expand Down Expand Up @@ -1685,7 +1691,9 @@ async def test_delete_customer_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].name == "name_value"
arg = args[0].name
mock_val = "name_value"
assert arg == mock_val


@pytest.mark.asyncio
Expand Down

0 comments on commit 203bfbb

Please sign in to comment.