Skip to content

Commit

Permalink
chore: use gapic-generator-python 0.56.2 (#102)
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] authored Nov 9, 2021
1 parent 3ca7f94 commit 160459c
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 37 deletions.
Original file line number Diff line number Diff line change
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.cloud.orgpolicy_v2.services.org_policy import pagers
from google.cloud.orgpolicy_v2.types import constraint
Expand Down
Original file line number Diff line number Diff line change
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.cloud.orgpolicy_v2.services.org_policy import pagers
from google.cloud.orgpolicy_v2.types import constraint
Expand Down Expand Up @@ -316,8 +318,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
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
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
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.auth import credentials as ga_credentials # type: ignore
from google.oauth2 import service_account # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
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 gapic_v1 # type: ignore
from google.api_core import grpc_helpers
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
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
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 gapic_v1
from google.api_core import grpc_helpers_async
from google.auth import credentials as ga_credentials # type: ignore
from google.auth.transport.grpc import SslCredentials # type: ignore

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,12 @@ class Constraint(proto.Message):
list_constraint (google.cloud.orgpolicy_v2.types.Constraint.ListConstraint):
Defines this constraint as being a
ListConstraint.
This field is a member of `oneof`_ ``constraint_type``.
boolean_constraint (google.cloud.orgpolicy_v2.types.Constraint.BooleanConstraint):
Defines this constraint as being a
BooleanConstraint.
This field is a member of `oneof`_ ``constraint_type``.
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,25 @@ class PolicyRule(proto.Message):
List of values to be used for this
PolicyRule. This field can be set only in
Policies for list constraints.
This field is a member of `oneof`_ ``kind``.
allow_all (bool):
Setting this to true means that all values
are allowed. This field can be set only in
Policies for list constraints.
This field is a member of `oneof`_ ``kind``.
deny_all (bool):
Setting this to true means that all values
are denied. This field can be set only in
Policies for list constraints.
This field is a member of `oneof`_ ``kind``.
enforce (bool):
If ``true``, then the ``Policy`` is enforced. If ``false``,
then any configuration is acceptable. This field can be set
only in Policies for boolean constraints.
This field is a member of `oneof`_ ``kind``.
condition (google.type.expr_pb2.Expr):
A condition which determines whether this rule is used in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,9 @@ def test_list_constraints_flattened():
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
arg = args[0].parent
mock_val = "parent_value"
assert arg == mock_val


def test_list_constraints_flattened_error():
Expand Down Expand Up @@ -648,7 +650,9 @@ async def test_list_constraints_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
arg = args[0].parent
mock_val = "parent_value"
assert arg == mock_val


@pytest.mark.asyncio
Expand Down Expand Up @@ -950,7 +954,9 @@ def test_list_policies_flattened():
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
arg = args[0].parent
mock_val = "parent_value"
assert arg == mock_val


def test_list_policies_flattened_error():
Expand Down Expand Up @@ -984,7 +990,9 @@ async def test_list_policies_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
arg = args[0].parent
mock_val = "parent_value"
assert arg == mock_val


@pytest.mark.asyncio
Expand Down Expand Up @@ -1264,7 +1272,9 @@ def test_get_policy_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_policy_flattened_error():
Expand Down Expand Up @@ -1296,7 +1306,9 @@ async def test_get_policy_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 @@ -1468,7 +1480,9 @@ def test_get_effective_policy_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_effective_policy_flattened_error():
Expand Down Expand Up @@ -1502,7 +1516,9 @@ async def test_get_effective_policy_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 @@ -1664,8 +1680,12 @@ def test_create_policy_flattened():
# request object values.
assert len(call.mock_calls) == 1
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
assert args[0].policy == orgpolicy.Policy(name="name_value")
arg = args[0].parent
mock_val = "parent_value"
assert arg == mock_val
arg = args[0].policy
mock_val = orgpolicy.Policy(name="name_value")
assert arg == mock_val


def test_create_policy_flattened_error():
Expand Down Expand Up @@ -1701,8 +1721,12 @@ async def test_create_policy_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].parent == "parent_value"
assert args[0].policy == orgpolicy.Policy(name="name_value")
arg = args[0].parent
mock_val = "parent_value"
assert arg == mock_val
arg = args[0].policy
mock_val = orgpolicy.Policy(name="name_value")
assert arg == mock_val


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


def test_update_policy_flattened_error():
Expand Down Expand Up @@ -1898,7 +1924,9 @@ async def test_update_policy_flattened_async():
# request object values.
assert len(call.mock_calls)
_, args, _ = call.mock_calls[0]
assert args[0].policy == orgpolicy.Policy(name="name_value")
arg = args[0].policy
mock_val = orgpolicy.Policy(name="name_value")
assert arg == mock_val


@pytest.mark.asyncio
Expand Down Expand Up @@ -2054,7 +2082,9 @@ def test_delete_policy_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_policy_flattened_error():
Expand Down Expand Up @@ -2086,7 +2116,9 @@ async def test_delete_policy_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 160459c

Please sign in to comment.