diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bc893c9..757c9dc 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 0000000..311ebbb --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb..238b87b 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] diff --git a/CHANGELOG.md b/CHANGELOG.md index 08cb000..9cd98b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [1.4.0](https://github.com/googleapis/python-appengine-admin/compare/v1.3.3...v1.4.0) (2022-05-05) + + +### Features + +* add Application.service_account ([#134](https://github.com/googleapis/python-appengine-admin/issues/134)) ([595a87c](https://github.com/googleapis/python-appengine-admin/commit/595a87cd561cf26da72599adc6750fdf20a2f1b5)) +* add client library method signature to retrieve Application by name ([595a87c](https://github.com/googleapis/python-appengine-admin/commit/595a87cd561cf26da72599adc6750fdf20a2f1b5)) +* add Service.labels ([595a87c](https://github.com/googleapis/python-appengine-admin/commit/595a87cd561cf26da72599adc6750fdf20a2f1b5)) +* add Version.app_engine_apis ([595a87c](https://github.com/googleapis/python-appengine-admin/commit/595a87cd561cf26da72599adc6750fdf20a2f1b5)) +* add VpcAccessConnector.egress_setting ([595a87c](https://github.com/googleapis/python-appengine-admin/commit/595a87cd561cf26da72599adc6750fdf20a2f1b5)) + ### [1.3.3](https://github.com/googleapis/python-appengine-admin/compare/v1.3.2...v1.3.3) (2022-04-14) diff --git a/google/cloud/appengine_admin_v1/services/applications/async_client.py b/google/cloud/appengine_admin_v1/services/applications/async_client.py index 56b440f..5bf8dd9 100644 --- a/google/cloud/appengine_admin_v1/services/applications/async_client.py +++ b/google/cloud/appengine_admin_v1/services/applications/async_client.py @@ -204,6 +204,7 @@ async def get_application( self, request: Union[appengine.GetApplicationRequest, dict] = None, *, + name: str = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), @@ -214,16 +215,16 @@ async def get_application( from google.cloud import appengine_admin_v1 - def sample_get_application(): + async def sample_get_application(): # Create a client - client = appengine_admin_v1.ApplicationsClient() + client = appengine_admin_v1.ApplicationsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetApplicationRequest( ) # Make the request - response = client.get_application(request=request) + response = await client.get_application(request=request) # Handle the response print(response) @@ -232,6 +233,13 @@ def sample_get_application(): request (Union[google.cloud.appengine_admin_v1.types.GetApplicationRequest, dict]): The request object. Request message for `Applications.GetApplication`. + name (:class:`str`): + Name of the Application resource to get. Example: + ``apps/myapp``. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -246,8 +254,22 @@ def sample_get_application(): """ # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + request = appengine.GetApplicationRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name + # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. rpc = gapic_v1.method_async.wrap_method( @@ -297,9 +319,9 @@ async def create_application( from google.cloud import appengine_admin_v1 - def sample_create_application(): + async def sample_create_application(): # Create a client - client = appengine_admin_v1.ApplicationsClient() + client = appengine_admin_v1.ApplicationsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.CreateApplicationRequest( @@ -310,7 +332,7 @@ def sample_create_application(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -378,14 +400,16 @@ async def update_application( controlling user access to the application. - ``default_cookie_expiration`` - Cookie expiration policy for the application. + - ``iap`` - Identity-Aware Proxy properties for the + application. .. code-block:: python from google.cloud import appengine_admin_v1 - def sample_update_application(): + async def sample_update_application(): # Create a client - client = appengine_admin_v1.ApplicationsClient() + client = appengine_admin_v1.ApplicationsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.UpdateApplicationRequest( @@ -396,7 +420,7 @@ def sample_update_application(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -479,9 +503,9 @@ async def repair_application( from google.cloud import appengine_admin_v1 - def sample_repair_application(): + async def sample_repair_application(): # Create a client - client = appengine_admin_v1.ApplicationsClient() + client = appengine_admin_v1.ApplicationsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.RepairApplicationRequest( @@ -492,7 +516,7 @@ def sample_repair_application(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/appengine_admin_v1/services/applications/client.py b/google/cloud/appengine_admin_v1/services/applications/client.py index a7639dd..59b9cd8 100644 --- a/google/cloud/appengine_admin_v1/services/applications/client.py +++ b/google/cloud/appengine_admin_v1/services/applications/client.py @@ -410,6 +410,7 @@ def get_application( self, request: Union[appengine.GetApplicationRequest, dict] = None, *, + name: str = None, retry: OptionalRetry = gapic_v1.method.DEFAULT, timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), @@ -438,6 +439,13 @@ def sample_get_application(): request (Union[google.cloud.appengine_admin_v1.types.GetApplicationRequest, dict]): The request object. Request message for `Applications.GetApplication`. + name (str): + Name of the Application resource to get. Example: + ``apps/myapp``. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -452,12 +460,25 @@ def sample_get_application(): """ # Create or coerce a protobuf request object. + # Quick check: If we got a request object, we should *not* have + # gotten any keyword arguments that map to the request. + has_flattened_params = any([name]) + if request is not None and has_flattened_params: + raise ValueError( + "If the `request` argument is set, then none of " + "the individual field arguments should be set." + ) + # Minor optimization to avoid making a copy if the user passes # in a appengine.GetApplicationRequest. # There's no risk of modifying the input as we've already verified # there are no flattened fields. if not isinstance(request, appengine.GetApplicationRequest): request = appengine.GetApplicationRequest(request) + # If we have keyword arguments corresponding to fields on the + # request, apply these. + if name is not None: + request.name = name # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -586,6 +607,8 @@ def update_application( controlling user access to the application. - ``default_cookie_expiration`` - Cookie expiration policy for the application. + - ``iap`` - Identity-Aware Proxy properties for the + application. .. code-block:: python diff --git a/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py b/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py index cc65019..53f5dbe 100644 --- a/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py +++ b/google/cloud/appengine_admin_v1/services/applications/transports/grpc.py @@ -320,6 +320,8 @@ def update_application( controlling user access to the application. - ``default_cookie_expiration`` - Cookie expiration policy for the application. + - ``iap`` - Identity-Aware Proxy properties for the + application. Returns: Callable[[~.UpdateApplicationRequest], diff --git a/google/cloud/appengine_admin_v1/services/applications/transports/grpc_asyncio.py b/google/cloud/appengine_admin_v1/services/applications/transports/grpc_asyncio.py index f93b2ba..a4315b9 100644 --- a/google/cloud/appengine_admin_v1/services/applications/transports/grpc_asyncio.py +++ b/google/cloud/appengine_admin_v1/services/applications/transports/grpc_asyncio.py @@ -331,6 +331,8 @@ def update_application( controlling user access to the application. - ``default_cookie_expiration`` - Cookie expiration policy for the application. + - ``iap`` - Identity-Aware Proxy properties for the + application. Returns: Callable[[~.UpdateApplicationRequest], diff --git a/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py b/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py index ab172ac..4a3c010 100644 --- a/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py +++ b/google/cloud/appengine_admin_v1/services/authorized_certificates/async_client.py @@ -223,9 +223,9 @@ async def list_authorized_certificates( from google.cloud import appengine_admin_v1 - def sample_list_authorized_certificates(): + async def sample_list_authorized_certificates(): # Create a client - client = appengine_admin_v1.AuthorizedCertificatesClient() + client = appengine_admin_v1.AuthorizedCertificatesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListAuthorizedCertificatesRequest( @@ -235,7 +235,7 @@ def sample_list_authorized_certificates(): page_result = client.list_authorized_certificates(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -308,16 +308,16 @@ async def get_authorized_certificate( from google.cloud import appengine_admin_v1 - def sample_get_authorized_certificate(): + async def sample_get_authorized_certificate(): # Create a client - client = appengine_admin_v1.AuthorizedCertificatesClient() + client = appengine_admin_v1.AuthorizedCertificatesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetAuthorizedCertificateRequest( ) # Make the request - response = client.get_authorized_certificate(request=request) + response = await client.get_authorized_certificate(request=request) # Handle the response print(response) @@ -383,16 +383,16 @@ async def create_authorized_certificate( from google.cloud import appengine_admin_v1 - def sample_create_authorized_certificate(): + async def sample_create_authorized_certificate(): # Create a client - client = appengine_admin_v1.AuthorizedCertificatesClient() + client = appengine_admin_v1.AuthorizedCertificatesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.CreateAuthorizedCertificateRequest( ) # Make the request - response = client.create_authorized_certificate(request=request) + response = await client.create_authorized_certificate(request=request) # Handle the response print(response) @@ -463,16 +463,16 @@ async def update_authorized_certificate( from google.cloud import appengine_admin_v1 - def sample_update_authorized_certificate(): + async def sample_update_authorized_certificate(): # Create a client - client = appengine_admin_v1.AuthorizedCertificatesClient() + client = appengine_admin_v1.AuthorizedCertificatesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.UpdateAuthorizedCertificateRequest( ) # Make the request - response = client.update_authorized_certificate(request=request) + response = await client.update_authorized_certificate(request=request) # Handle the response print(response) @@ -538,16 +538,16 @@ async def delete_authorized_certificate( from google.cloud import appengine_admin_v1 - def sample_delete_authorized_certificate(): + async def sample_delete_authorized_certificate(): # Create a client - client = appengine_admin_v1.AuthorizedCertificatesClient() + client = appengine_admin_v1.AuthorizedCertificatesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DeleteAuthorizedCertificateRequest( ) # Make the request - client.delete_authorized_certificate(request=request) + await client.delete_authorized_certificate(request=request) Args: request (Union[google.cloud.appengine_admin_v1.types.DeleteAuthorizedCertificateRequest, dict]): diff --git a/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py b/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py index ed3bd05..5b79bb6 100644 --- a/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py +++ b/google/cloud/appengine_admin_v1/services/authorized_domains/async_client.py @@ -219,9 +219,9 @@ async def list_authorized_domains( from google.cloud import appengine_admin_v1 - def sample_list_authorized_domains(): + async def sample_list_authorized_domains(): # Create a client - client = appengine_admin_v1.AuthorizedDomainsClient() + client = appengine_admin_v1.AuthorizedDomainsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListAuthorizedDomainsRequest( @@ -231,7 +231,7 @@ def sample_list_authorized_domains(): page_result = client.list_authorized_domains(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: diff --git a/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py b/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py index f7f3838..69c656a 100644 --- a/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py +++ b/google/cloud/appengine_admin_v1/services/domain_mappings/async_client.py @@ -219,9 +219,9 @@ async def list_domain_mappings( from google.cloud import appengine_admin_v1 - def sample_list_domain_mappings(): + async def sample_list_domain_mappings(): # Create a client - client = appengine_admin_v1.DomainMappingsClient() + client = appengine_admin_v1.DomainMappingsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListDomainMappingsRequest( @@ -231,7 +231,7 @@ def sample_list_domain_mappings(): page_result = client.list_domain_mappings(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -303,16 +303,16 @@ async def get_domain_mapping( from google.cloud import appengine_admin_v1 - def sample_get_domain_mapping(): + async def sample_get_domain_mapping(): # Create a client - client = appengine_admin_v1.DomainMappingsClient() + client = appengine_admin_v1.DomainMappingsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetDomainMappingRequest( ) # Make the request - response = client.get_domain_mapping(request=request) + response = await client.get_domain_mapping(request=request) # Handle the response print(response) @@ -378,9 +378,9 @@ async def create_domain_mapping( from google.cloud import appengine_admin_v1 - def sample_create_domain_mapping(): + async def sample_create_domain_mapping(): # Create a client - client = appengine_admin_v1.DomainMappingsClient() + client = appengine_admin_v1.DomainMappingsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.CreateDomainMappingRequest( @@ -391,7 +391,7 @@ def sample_create_domain_mapping(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -469,9 +469,9 @@ async def update_domain_mapping( from google.cloud import appengine_admin_v1 - def sample_update_domain_mapping(): + async def sample_update_domain_mapping(): # Create a client - client = appengine_admin_v1.DomainMappingsClient() + client = appengine_admin_v1.DomainMappingsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.UpdateDomainMappingRequest( @@ -482,7 +482,7 @@ def sample_update_domain_mapping(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -558,9 +558,9 @@ async def delete_domain_mapping( from google.cloud import appengine_admin_v1 - def sample_delete_domain_mapping(): + async def sample_delete_domain_mapping(): # Create a client - client = appengine_admin_v1.DomainMappingsClient() + client = appengine_admin_v1.DomainMappingsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DeleteDomainMappingRequest( @@ -571,7 +571,7 @@ def sample_delete_domain_mapping(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/appengine_admin_v1/services/firewall/async_client.py b/google/cloud/appengine_admin_v1/services/firewall/async_client.py index 45508d8..eb65073 100644 --- a/google/cloud/appengine_admin_v1/services/firewall/async_client.py +++ b/google/cloud/appengine_admin_v1/services/firewall/async_client.py @@ -218,9 +218,9 @@ async def list_ingress_rules( from google.cloud import appengine_admin_v1 - def sample_list_ingress_rules(): + async def sample_list_ingress_rules(): # Create a client - client = appengine_admin_v1.FirewallClient() + client = appengine_admin_v1.FirewallAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListIngressRulesRequest( @@ -230,7 +230,7 @@ def sample_list_ingress_rules(): page_result = client.list_ingress_rules(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -308,16 +308,16 @@ async def batch_update_ingress_rules( from google.cloud import appengine_admin_v1 - def sample_batch_update_ingress_rules(): + async def sample_batch_update_ingress_rules(): # Create a client - client = appengine_admin_v1.FirewallClient() + client = appengine_admin_v1.FirewallAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.BatchUpdateIngressRulesRequest( ) # Make the request - response = client.batch_update_ingress_rules(request=request) + response = await client.batch_update_ingress_rules(request=request) # Handle the response print(response) @@ -378,16 +378,16 @@ async def create_ingress_rule( from google.cloud import appengine_admin_v1 - def sample_create_ingress_rule(): + async def sample_create_ingress_rule(): # Create a client - client = appengine_admin_v1.FirewallClient() + client = appengine_admin_v1.FirewallAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.CreateIngressRuleRequest( ) # Make the request - response = client.create_ingress_rule(request=request) + response = await client.create_ingress_rule(request=request) # Handle the response print(response) @@ -452,16 +452,16 @@ async def get_ingress_rule( from google.cloud import appengine_admin_v1 - def sample_get_ingress_rule(): + async def sample_get_ingress_rule(): # Create a client - client = appengine_admin_v1.FirewallClient() + client = appengine_admin_v1.FirewallAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetIngressRuleRequest( ) # Make the request - response = client.get_ingress_rule(request=request) + response = await client.get_ingress_rule(request=request) # Handle the response print(response) @@ -526,16 +526,16 @@ async def update_ingress_rule( from google.cloud import appengine_admin_v1 - def sample_update_ingress_rule(): + async def sample_update_ingress_rule(): # Create a client - client = appengine_admin_v1.FirewallClient() + client = appengine_admin_v1.FirewallAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.UpdateIngressRuleRequest( ) # Make the request - response = client.update_ingress_rule(request=request) + response = await client.update_ingress_rule(request=request) # Handle the response print(response) @@ -600,16 +600,16 @@ async def delete_ingress_rule( from google.cloud import appengine_admin_v1 - def sample_delete_ingress_rule(): + async def sample_delete_ingress_rule(): # Create a client - client = appengine_admin_v1.FirewallClient() + client = appengine_admin_v1.FirewallAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DeleteIngressRuleRequest( ) # Make the request - client.delete_ingress_rule(request=request) + await client.delete_ingress_rule(request=request) Args: request (Union[google.cloud.appengine_admin_v1.types.DeleteIngressRuleRequest, dict]): diff --git a/google/cloud/appengine_admin_v1/services/instances/async_client.py b/google/cloud/appengine_admin_v1/services/instances/async_client.py index 4108316..7ac7e95 100644 --- a/google/cloud/appengine_admin_v1/services/instances/async_client.py +++ b/google/cloud/appengine_admin_v1/services/instances/async_client.py @@ -220,9 +220,9 @@ async def list_instances( from google.cloud import appengine_admin_v1 - def sample_list_instances(): + async def sample_list_instances(): # Create a client - client = appengine_admin_v1.InstancesClient() + client = appengine_admin_v1.InstancesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListInstancesRequest( @@ -232,7 +232,7 @@ def sample_list_instances(): page_result = client.list_instances(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -304,16 +304,16 @@ async def get_instance( from google.cloud import appengine_admin_v1 - def sample_get_instance(): + async def sample_get_instance(): # Create a client - client = appengine_admin_v1.InstancesClient() + client = appengine_admin_v1.InstancesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetInstanceRequest( ) # Make the request - response = client.get_instance(request=request) + response = await client.get_instance(request=request) # Handle the response print(response) @@ -391,9 +391,9 @@ async def delete_instance( from google.cloud import appengine_admin_v1 - def sample_delete_instance(): + async def sample_delete_instance(): # Create a client - client = appengine_admin_v1.InstancesClient() + client = appengine_admin_v1.InstancesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DeleteInstanceRequest( @@ -404,7 +404,7 @@ def sample_delete_instance(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -497,9 +497,9 @@ async def debug_instance( from google.cloud import appengine_admin_v1 - def sample_debug_instance(): + async def sample_debug_instance(): # Create a client - client = appengine_admin_v1.InstancesClient() + client = appengine_admin_v1.InstancesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DebugInstanceRequest( @@ -510,7 +510,7 @@ def sample_debug_instance(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/appengine_admin_v1/services/services/async_client.py b/google/cloud/appengine_admin_v1/services/services/async_client.py index c73da6d..1e28bde 100644 --- a/google/cloud/appengine_admin_v1/services/services/async_client.py +++ b/google/cloud/appengine_admin_v1/services/services/async_client.py @@ -212,9 +212,9 @@ async def list_services( from google.cloud import appengine_admin_v1 - def sample_list_services(): + async def sample_list_services(): # Create a client - client = appengine_admin_v1.ServicesClient() + client = appengine_admin_v1.ServicesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListServicesRequest( @@ -224,7 +224,7 @@ def sample_list_services(): page_result = client.list_services(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -297,16 +297,16 @@ async def get_service( from google.cloud import appengine_admin_v1 - def sample_get_service(): + async def sample_get_service(): # Create a client - client = appengine_admin_v1.ServicesClient() + client = appengine_admin_v1.ServicesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetServiceRequest( ) # Make the request - response = client.get_service(request=request) + response = await client.get_service(request=request) # Handle the response print(response) @@ -379,9 +379,9 @@ async def update_service( from google.cloud import appengine_admin_v1 - def sample_update_service(): + async def sample_update_service(): # Create a client - client = appengine_admin_v1.ServicesClient() + client = appengine_admin_v1.ServicesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.UpdateServiceRequest( @@ -392,7 +392,7 @@ def sample_update_service(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -473,9 +473,9 @@ async def delete_service( from google.cloud import appengine_admin_v1 - def sample_delete_service(): + async def sample_delete_service(): # Create a client - client = appengine_admin_v1.ServicesClient() + client = appengine_admin_v1.ServicesAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DeleteServiceRequest( @@ -486,7 +486,7 @@ def sample_delete_service(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/appengine_admin_v1/services/versions/async_client.py b/google/cloud/appengine_admin_v1/services/versions/async_client.py index 3265a5a..1ed6d88 100644 --- a/google/cloud/appengine_admin_v1/services/versions/async_client.py +++ b/google/cloud/appengine_admin_v1/services/versions/async_client.py @@ -215,9 +215,9 @@ async def list_versions( from google.cloud import appengine_admin_v1 - def sample_list_versions(): + async def sample_list_versions(): # Create a client - client = appengine_admin_v1.VersionsClient() + client = appengine_admin_v1.VersionsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.ListVersionsRequest( @@ -227,7 +227,7 @@ def sample_list_versions(): page_result = client.list_versions(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -301,16 +301,16 @@ async def get_version( from google.cloud import appengine_admin_v1 - def sample_get_version(): + async def sample_get_version(): # Create a client - client = appengine_admin_v1.VersionsClient() + client = appengine_admin_v1.VersionsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.GetVersionRequest( ) # Make the request - response = client.get_version(request=request) + response = await client.get_version(request=request) # Handle the response print(response) @@ -374,9 +374,9 @@ async def create_version( from google.cloud import appengine_admin_v1 - def sample_create_version(): + async def sample_create_version(): # Create a client - client = appengine_admin_v1.VersionsClient() + client = appengine_admin_v1.VersionsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.CreateVersionRequest( @@ -387,7 +387,7 @@ def sample_create_version(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -495,9 +495,9 @@ async def update_version( from google.cloud import appengine_admin_v1 - def sample_update_version(): + async def sample_update_version(): # Create a client - client = appengine_admin_v1.VersionsClient() + client = appengine_admin_v1.VersionsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.UpdateVersionRequest( @@ -508,7 +508,7 @@ def sample_update_version(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) @@ -581,9 +581,9 @@ async def delete_version( from google.cloud import appengine_admin_v1 - def sample_delete_version(): + async def sample_delete_version(): # Create a client - client = appengine_admin_v1.VersionsClient() + client = appengine_admin_v1.VersionsAsyncClient() # Initialize request argument(s) request = appengine_admin_v1.DeleteVersionRequest( @@ -594,7 +594,7 @@ def sample_delete_version(): print("Waiting for operation to complete...") - response = operation.result() + response = await operation.result() # Handle the response print(response) diff --git a/google/cloud/appengine_admin_v1/types/appengine.py b/google/cloud/appengine_admin_v1/types/appengine.py index be12296..f4427c2 100644 --- a/google/cloud/appengine_admin_v1/types/appengine.py +++ b/google/cloud/appengine_admin_v1/types/appengine.py @@ -142,8 +142,8 @@ class UpdateApplicationRequest(proto.Message): An Application containing the updated resource. update_mask (google.protobuf.field_mask_pb2.FieldMask): - Standard field mask for the set of fields to - be updated. + Required. Standard field mask for the set of + fields to be updated. """ name = proto.Field( @@ -258,8 +258,8 @@ class UpdateServiceRequest(proto.Message): service. Only fields set in the field mask will be updated. update_mask (google.protobuf.field_mask_pb2.FieldMask): - Standard field mask for the set of fields to - be updated. + Required. Standard field mask for the set of + fields to be updated. migrate_traffic (bool): Set to ``true`` to gradually shift traffic to one or more versions that you specify. By default, traffic is shifted @@ -1101,8 +1101,8 @@ class UpdateDomainMappingRequest(proto.Message): resource. Only fields set in the field mask will be updated. update_mask (google.protobuf.field_mask_pb2.FieldMask): - Standard field mask for the set of fields to - be updated. + Required. Standard field mask for the set of + fields to be updated. """ name = proto.Field( diff --git a/google/cloud/appengine_admin_v1/types/application.py b/google/cloud/appengine_admin_v1/types/application.py index 263562d..f7687e5 100644 --- a/google/cloud/appengine_admin_v1/types/application.py +++ b/google/cloud/appengine_admin_v1/types/application.py @@ -83,6 +83,11 @@ class Application(proto.Message): by this application to store content. @OutputOnly + service_account (str): + The service account associated with the + application. This is the app-level default + identity. If no identity provided during create + version, Admin API will fallback to this one. iap (google.cloud.appengine_admin_v1.types.Application.IdentityAwareProxy): gcr_domain (str): @@ -226,6 +231,10 @@ class FeatureSettings(proto.Message): proto.STRING, number=12, ) + service_account = proto.Field( + proto.STRING, + number=13, + ) iap = proto.Field( proto.MESSAGE, number=14, diff --git a/google/cloud/appengine_admin_v1/types/service.py b/google/cloud/appengine_admin_v1/types/service.py index 77e2608..c42ffec 100644 --- a/google/cloud/appengine_admin_v1/types/service.py +++ b/google/cloud/appengine_admin_v1/types/service.py @@ -54,6 +54,24 @@ class Service(proto.Message): Mapping that defines fractional HTTP traffic diversion to different versions within the service. + labels (Mapping[str, str]): + A set of labels to apply to this service. + Labels are key/value pairs that describe the + service and all resources that belong to it + (e.g., versions). The labels can be used to + search and group resources, and are propagated + to the usage and billing reports, enabling + fine-grain analysis of costs. An example of + using labels is to tag resources belonging to + different environments (e.g., "env=prod", + "env=qa"). +

Label keys and values can be no longer than + 63 characters and can only contain lowercase + letters, numeric characters, underscores, + dashes, and international characters. Label keys + must start with a lowercase letter or an + international character. Each service can have + at most 32 labels. network_settings (google.cloud.appengine_admin_v1.types.NetworkSettings): Ingress settings for this service. Will apply to all versions. @@ -72,6 +90,11 @@ class Service(proto.Message): number=3, message="TrafficSplit", ) + labels = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) network_settings = proto.Field( proto.MESSAGE, number=6, diff --git a/google/cloud/appengine_admin_v1/types/version.py b/google/cloud/appengine_admin_v1/types/version.py index 7ea3028..0bd5458 100644 --- a/google/cloud/appengine_admin_v1/types/version.py +++ b/google/cloud/appengine_admin_v1/types/version.py @@ -148,6 +148,9 @@ class Version(proto.Message): vm (bool): Whether to deploy this version in a container on a virtual machine. + app_engine_apis (bool): + Allows App Engine second generation runtimes + to access the legacy bundled services. beta_settings (Mapping[str, str]): Metadata settings that are supplied to this version to enable beta runtime features. @@ -330,6 +333,10 @@ class Version(proto.Message): proto.BOOL, number=12, ) + app_engine_apis = proto.Field( + proto.BOOL, + number=128, + ) beta_settings = proto.MapField( proto.STRING, proto.STRING, @@ -964,12 +971,30 @@ class VpcAccessConnector(proto.Message): Full Serverless VPC Access Connector name e.g. /projects/my-project/locations/us-central1/connectors/c1. + egress_setting (google.cloud.appengine_admin_v1.types.VpcAccessConnector.EgressSetting): + The egress setting for the connector, + controlling what traffic is diverted through it. """ + class EgressSetting(proto.Enum): + r"""Available egress settings. + + This controls what traffic is diverted through the VPC Access + Connector resource. By default PRIVATE_IP_RANGES will be used. + """ + EGRESS_SETTING_UNSPECIFIED = 0 + ALL_TRAFFIC = 1 + PRIVATE_IP_RANGES = 2 + name = proto.Field( proto.STRING, number=1, ) + egress_setting = proto.Field( + proto.ENUM, + number=2, + enum=EgressSetting, + ) class Entrypoint(proto.Message): diff --git a/noxfile.py b/noxfile.py index 6ee5e8a..92da31f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,7 +25,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +84,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +95,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/samples/generated_samples/snippet_metadata_appengine admin_v1.json b/samples/generated_samples/snippet_metadata_appengine admin_v1.json index 7d498a2..a3212d2 100644 --- a/samples/generated_samples/snippet_metadata_appengine admin_v1.json +++ b/samples/generated_samples/snippet_metadata_appengine admin_v1.json @@ -185,6 +185,10 @@ "name": "request", "type": "google.cloud.appengine_admin_v1.types.GetApplicationRequest" }, + { + "name": "name", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" @@ -261,6 +265,10 @@ "name": "request", "type": "google.cloud.appengine_admin_v1.types.GetApplicationRequest" }, + { + "name": "name", + "type": "str" + }, { "name": "retry", "type": "google.api_core.retry.Retry" diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e..91b5967 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') diff --git a/setup.py b/setup.py index c82e031..dc285df 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ import setuptools # type: ignore name = "google-cloud-appengine-admin" -version = "1.3.3" +version = "1.4.0" description = "App Engine Admin API client library" release_status = "Development Status :: 5 - Production/Stable" url = "https://github.com/googleapis/python-appengine-admin" diff --git a/tests/unit/gapic/appengine_admin_v1/test_applications.py b/tests/unit/gapic/appengine_admin_v1/test_applications.py index 8fa343a..205bbeb 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_applications.py +++ b/tests/unit/gapic/appengine_admin_v1/test_applications.py @@ -675,6 +675,7 @@ def test_get_application(request_type, transport: str = "grpc"): serving_status=application.Application.ServingStatus.SERVING, default_hostname="default_hostname_value", default_bucket="default_bucket_value", + service_account="service_account_value", gcr_domain="gcr_domain_value", database_type=application.Application.DatabaseType.CLOUD_DATASTORE, ) @@ -695,6 +696,7 @@ def test_get_application(request_type, transport: str = "grpc"): assert response.serving_status == application.Application.ServingStatus.SERVING assert response.default_hostname == "default_hostname_value" assert response.default_bucket == "default_bucket_value" + assert response.service_account == "service_account_value" assert response.gcr_domain == "gcr_domain_value" assert ( response.database_type == application.Application.DatabaseType.CLOUD_DATASTORE @@ -743,6 +745,7 @@ async def test_get_application_async( serving_status=application.Application.ServingStatus.SERVING, default_hostname="default_hostname_value", default_bucket="default_bucket_value", + service_account="service_account_value", gcr_domain="gcr_domain_value", database_type=application.Application.DatabaseType.CLOUD_DATASTORE, ) @@ -764,6 +767,7 @@ async def test_get_application_async( assert response.serving_status == application.Application.ServingStatus.SERVING assert response.default_hostname == "default_hostname_value" assert response.default_bucket == "default_bucket_value" + assert response.service_account == "service_account_value" assert response.gcr_domain == "gcr_domain_value" assert ( response.database_type == application.Application.DatabaseType.CLOUD_DATASTORE @@ -784,7 +788,7 @@ def test_get_application_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_application), "__call__") as call: @@ -800,7 +804,7 @@ def test_get_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -814,7 +818,7 @@ async def test_get_application_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_application), "__call__") as call: @@ -832,10 +836,92 @@ async def test_get_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] +def test_get_application_flattened(): + client = ApplicationsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_application), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = application.Application() + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + client.get_application( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) == 1 + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +def test_get_application_flattened_error(): + client = ApplicationsClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + client.get_application( + appengine.GetApplicationRequest(), + name="name_value", + ) + + +@pytest.mark.asyncio +async def test_get_application_flattened_async(): + client = ApplicationsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Mock the actual call within the gRPC stub, and fake the request. + with mock.patch.object(type(client.transport.get_application), "__call__") as call: + # Designate an appropriate return value for the call. + call.return_value = application.Application() + + call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( + application.Application() + ) + # Call the method with a truthy value for each flattened field, + # using the keyword arguments to the method. + response = await client.get_application( + name="name_value", + ) + + # Establish that the underlying call was made with the expected + # request object values. + assert len(call.mock_calls) + _, args, _ = call.mock_calls[0] + arg = args[0].name + mock_val = "name_value" + assert arg == mock_val + + +@pytest.mark.asyncio +async def test_get_application_flattened_error_async(): + client = ApplicationsAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Attempting to call a method with both a request object and flattened + # fields is an error. + with pytest.raises(ValueError): + await client.get_application( + appengine.GetApplicationRequest(), + name="name_value", + ) + + @pytest.mark.parametrize( "request_type", [ @@ -1023,7 +1109,7 @@ def test_update_application_field_headers(): # a field header. Set these to a non-empty value. request = appengine.UpdateApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1041,7 +1127,7 @@ def test_update_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1055,7 +1141,7 @@ async def test_update_application_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.UpdateApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1075,7 +1161,7 @@ async def test_update_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1177,7 +1263,7 @@ def test_repair_application_field_headers(): # a field header. Set these to a non-empty value. request = appengine.RepairApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1195,7 +1281,7 @@ def test_repair_application_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1209,7 +1295,7 @@ async def test_repair_application_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.RepairApplicationRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1229,7 +1315,7 @@ async def test_repair_application_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py b/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py index ad07779..9e95c2e 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py +++ b/tests/unit/gapic/appengine_admin_v1/test_authorized_certificates.py @@ -784,7 +784,7 @@ def test_list_authorized_certificates_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListAuthorizedCertificatesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -802,7 +802,7 @@ def test_list_authorized_certificates_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -816,7 +816,7 @@ async def test_list_authorized_certificates_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListAuthorizedCertificatesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -836,7 +836,7 @@ async def test_list_authorized_certificates_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -887,7 +887,7 @@ def test_list_authorized_certificates_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, certificate.AuthorizedCertificate) for i in results) @@ -1161,7 +1161,7 @@ def test_get_authorized_certificate_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetAuthorizedCertificateRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1179,7 +1179,7 @@ def test_get_authorized_certificate_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1193,7 +1193,7 @@ async def test_get_authorized_certificate_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetAuthorizedCertificateRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1213,7 +1213,7 @@ async def test_get_authorized_certificate_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1342,7 +1342,7 @@ def test_create_authorized_certificate_field_headers(): # a field header. Set these to a non-empty value. request = appengine.CreateAuthorizedCertificateRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1360,7 +1360,7 @@ def test_create_authorized_certificate_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1374,7 +1374,7 @@ async def test_create_authorized_certificate_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.CreateAuthorizedCertificateRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1394,7 +1394,7 @@ async def test_create_authorized_certificate_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1523,7 +1523,7 @@ def test_update_authorized_certificate_field_headers(): # a field header. Set these to a non-empty value. request = appengine.UpdateAuthorizedCertificateRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1541,7 +1541,7 @@ def test_update_authorized_certificate_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1555,7 +1555,7 @@ async def test_update_authorized_certificate_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.UpdateAuthorizedCertificateRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1575,7 +1575,7 @@ async def test_update_authorized_certificate_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1676,7 +1676,7 @@ def test_delete_authorized_certificate_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DeleteAuthorizedCertificateRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1694,7 +1694,7 @@ def test_delete_authorized_certificate_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1708,7 +1708,7 @@ async def test_delete_authorized_certificate_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DeleteAuthorizedCertificateRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1726,7 +1726,7 @@ async def test_delete_authorized_certificate_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py b/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py index 728aef6..19b8ae1 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py +++ b/tests/unit/gapic/appengine_admin_v1/test_authorized_domains.py @@ -773,7 +773,7 @@ def test_list_authorized_domains_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListAuthorizedDomainsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -791,7 +791,7 @@ def test_list_authorized_domains_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -805,7 +805,7 @@ async def test_list_authorized_domains_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListAuthorizedDomainsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -825,7 +825,7 @@ async def test_list_authorized_domains_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -876,7 +876,7 @@ def test_list_authorized_domains_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, domain.AuthorizedDomain) for i in results) diff --git a/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py b/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py index 3ca570d..4ddf609 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py +++ b/tests/unit/gapic/appengine_admin_v1/test_domain_mappings.py @@ -765,7 +765,7 @@ def test_list_domain_mappings_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListDomainMappingsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -783,7 +783,7 @@ def test_list_domain_mappings_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -797,7 +797,7 @@ async def test_list_domain_mappings_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListDomainMappingsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -817,7 +817,7 @@ async def test_list_domain_mappings_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -868,7 +868,7 @@ def test_list_domain_mappings_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, domain_mapping.DomainMapping) for i in results) @@ -1125,7 +1125,7 @@ def test_get_domain_mapping_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetDomainMappingRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1143,7 +1143,7 @@ def test_get_domain_mapping_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1157,7 +1157,7 @@ async def test_get_domain_mapping_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetDomainMappingRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1177,7 +1177,7 @@ async def test_get_domain_mapping_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1279,7 +1279,7 @@ def test_create_domain_mapping_field_headers(): # a field header. Set these to a non-empty value. request = appengine.CreateDomainMappingRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1297,7 +1297,7 @@ def test_create_domain_mapping_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1311,7 +1311,7 @@ async def test_create_domain_mapping_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.CreateDomainMappingRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1331,7 +1331,7 @@ async def test_create_domain_mapping_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1433,7 +1433,7 @@ def test_update_domain_mapping_field_headers(): # a field header. Set these to a non-empty value. request = appengine.UpdateDomainMappingRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1451,7 +1451,7 @@ def test_update_domain_mapping_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1465,7 +1465,7 @@ async def test_update_domain_mapping_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.UpdateDomainMappingRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1485,7 +1485,7 @@ async def test_update_domain_mapping_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1587,7 +1587,7 @@ def test_delete_domain_mapping_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DeleteDomainMappingRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1605,7 +1605,7 @@ def test_delete_domain_mapping_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1619,7 +1619,7 @@ async def test_delete_domain_mapping_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DeleteDomainMappingRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1639,7 +1639,7 @@ async def test_delete_domain_mapping_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/appengine_admin_v1/test_firewall.py b/tests/unit/gapic/appengine_admin_v1/test_firewall.py index 19a09af..9291205 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_firewall.py +++ b/tests/unit/gapic/appengine_admin_v1/test_firewall.py @@ -720,7 +720,7 @@ def test_list_ingress_rules_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListIngressRulesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -738,7 +738,7 @@ def test_list_ingress_rules_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -752,7 +752,7 @@ async def test_list_ingress_rules_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListIngressRulesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -772,7 +772,7 @@ async def test_list_ingress_rules_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -823,7 +823,7 @@ def test_list_ingress_rules_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, firewall.FirewallRule) for i in results) @@ -1071,7 +1071,7 @@ def test_batch_update_ingress_rules_field_headers(): # a field header. Set these to a non-empty value. request = appengine.BatchUpdateIngressRulesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1089,7 +1089,7 @@ def test_batch_update_ingress_rules_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1103,7 +1103,7 @@ async def test_batch_update_ingress_rules_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.BatchUpdateIngressRulesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1123,7 +1123,7 @@ async def test_batch_update_ingress_rules_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1243,7 +1243,7 @@ def test_create_ingress_rule_field_headers(): # a field header. Set these to a non-empty value. request = appengine.CreateIngressRuleRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1261,7 +1261,7 @@ def test_create_ingress_rule_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1275,7 +1275,7 @@ async def test_create_ingress_rule_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.CreateIngressRuleRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1295,7 +1295,7 @@ async def test_create_ingress_rule_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1409,7 +1409,7 @@ def test_get_ingress_rule_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetIngressRuleRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_ingress_rule), "__call__") as call: @@ -1425,7 +1425,7 @@ def test_get_ingress_rule_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1439,7 +1439,7 @@ async def test_get_ingress_rule_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetIngressRuleRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_ingress_rule), "__call__") as call: @@ -1457,7 +1457,7 @@ async def test_get_ingress_rule_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1577,7 +1577,7 @@ def test_update_ingress_rule_field_headers(): # a field header. Set these to a non-empty value. request = appengine.UpdateIngressRuleRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1595,7 +1595,7 @@ def test_update_ingress_rule_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1609,7 +1609,7 @@ async def test_update_ingress_rule_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.UpdateIngressRuleRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1629,7 +1629,7 @@ async def test_update_ingress_rule_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1729,7 +1729,7 @@ def test_delete_ingress_rule_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DeleteIngressRuleRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1747,7 +1747,7 @@ def test_delete_ingress_rule_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1761,7 +1761,7 @@ async def test_delete_ingress_rule_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DeleteIngressRuleRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1779,7 +1779,7 @@ async def test_delete_ingress_rule_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/appengine_admin_v1/test_instances.py b/tests/unit/gapic/appengine_admin_v1/test_instances.py index 0a2ab1d..14a3ade 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_instances.py +++ b/tests/unit/gapic/appengine_admin_v1/test_instances.py @@ -728,7 +728,7 @@ def test_list_instances_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListInstancesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_instances), "__call__") as call: @@ -744,7 +744,7 @@ def test_list_instances_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -758,7 +758,7 @@ async def test_list_instances_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListInstancesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_instances), "__call__") as call: @@ -776,7 +776,7 @@ async def test_list_instances_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -825,7 +825,7 @@ def test_list_instances_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, instance.Instance) for i in results) @@ -1126,7 +1126,7 @@ def test_get_instance_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetInstanceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_instance), "__call__") as call: @@ -1142,7 +1142,7 @@ def test_get_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1156,7 +1156,7 @@ async def test_get_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetInstanceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_instance), "__call__") as call: @@ -1172,7 +1172,7 @@ async def test_get_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1268,7 +1268,7 @@ def test_delete_instance_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DeleteInstanceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_instance), "__call__") as call: @@ -1284,7 +1284,7 @@ def test_delete_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1298,7 +1298,7 @@ async def test_delete_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DeleteInstanceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_instance), "__call__") as call: @@ -1316,7 +1316,7 @@ async def test_delete_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1412,7 +1412,7 @@ def test_debug_instance_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DebugInstanceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.debug_instance), "__call__") as call: @@ -1428,7 +1428,7 @@ def test_debug_instance_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1442,7 +1442,7 @@ async def test_debug_instance_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DebugInstanceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.debug_instance), "__call__") as call: @@ -1460,7 +1460,7 @@ async def test_debug_instance_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/appengine_admin_v1/test_services.py b/tests/unit/gapic/appengine_admin_v1/test_services.py index 361eee1..9b60574 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_services.py +++ b/tests/unit/gapic/appengine_admin_v1/test_services.py @@ -721,7 +721,7 @@ def test_list_services_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListServicesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_services), "__call__") as call: @@ -737,7 +737,7 @@ def test_list_services_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -751,7 +751,7 @@ async def test_list_services_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListServicesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_services), "__call__") as call: @@ -769,7 +769,7 @@ async def test_list_services_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -818,7 +818,7 @@ def test_list_services_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, service.Service) for i in results) @@ -1063,7 +1063,7 @@ def test_get_service_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetServiceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_service), "__call__") as call: @@ -1079,7 +1079,7 @@ def test_get_service_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1093,7 +1093,7 @@ async def test_get_service_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetServiceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_service), "__call__") as call: @@ -1109,7 +1109,7 @@ async def test_get_service_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1205,7 +1205,7 @@ def test_update_service_field_headers(): # a field header. Set these to a non-empty value. request = appengine.UpdateServiceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_service), "__call__") as call: @@ -1221,7 +1221,7 @@ def test_update_service_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1235,7 +1235,7 @@ async def test_update_service_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.UpdateServiceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_service), "__call__") as call: @@ -1253,7 +1253,7 @@ async def test_update_service_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1349,7 +1349,7 @@ def test_delete_service_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DeleteServiceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_service), "__call__") as call: @@ -1365,7 +1365,7 @@ def test_delete_service_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1379,7 +1379,7 @@ async def test_delete_service_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DeleteServiceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_service), "__call__") as call: @@ -1397,7 +1397,7 @@ async def test_delete_service_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/appengine_admin_v1/test_versions.py b/tests/unit/gapic/appengine_admin_v1/test_versions.py index 4b5a631..9bf3cd1 100644 --- a/tests/unit/gapic/appengine_admin_v1/test_versions.py +++ b/tests/unit/gapic/appengine_admin_v1/test_versions.py @@ -724,7 +724,7 @@ def test_list_versions_field_headers(): # a field header. Set these to a non-empty value. request = appengine.ListVersionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_versions), "__call__") as call: @@ -740,7 +740,7 @@ def test_list_versions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -754,7 +754,7 @@ async def test_list_versions_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.ListVersionsRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_versions), "__call__") as call: @@ -772,7 +772,7 @@ async def test_list_versions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -821,7 +821,7 @@ def test_list_versions_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, version.Version) for i in results) @@ -994,6 +994,7 @@ def test_get_version(request_type, transport: str = "grpc"): runtime_channel="runtime_channel_value", threadsafe=True, vm=True, + app_engine_apis=True, env="env_value", serving_status=version.ServingStatus.SERVING, created_by="created_by_value", @@ -1027,6 +1028,7 @@ def test_get_version(request_type, transport: str = "grpc"): assert response.runtime_channel == "runtime_channel_value" assert response.threadsafe is True assert response.vm is True + assert response.app_engine_apis is True assert response.env == "env_value" assert response.serving_status == version.ServingStatus.SERVING assert response.created_by == "created_by_value" @@ -1081,6 +1083,7 @@ async def test_get_version_async( runtime_channel="runtime_channel_value", threadsafe=True, vm=True, + app_engine_apis=True, env="env_value", serving_status=version.ServingStatus.SERVING, created_by="created_by_value", @@ -1112,6 +1115,7 @@ async def test_get_version_async( assert response.runtime_channel == "runtime_channel_value" assert response.threadsafe is True assert response.vm is True + assert response.app_engine_apis is True assert response.env == "env_value" assert response.serving_status == version.ServingStatus.SERVING assert response.created_by == "created_by_value" @@ -1137,7 +1141,7 @@ def test_get_version_field_headers(): # a field header. Set these to a non-empty value. request = appengine.GetVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_version), "__call__") as call: @@ -1153,7 +1157,7 @@ def test_get_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1167,7 +1171,7 @@ async def test_get_version_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.GetVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_version), "__call__") as call: @@ -1183,7 +1187,7 @@ async def test_get_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1279,7 +1283,7 @@ def test_create_version_field_headers(): # a field header. Set these to a non-empty value. request = appengine.CreateVersionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_version), "__call__") as call: @@ -1295,7 +1299,7 @@ def test_create_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1309,7 +1313,7 @@ async def test_create_version_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.CreateVersionRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_version), "__call__") as call: @@ -1327,7 +1331,7 @@ async def test_create_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1423,7 +1427,7 @@ def test_update_version_field_headers(): # a field header. Set these to a non-empty value. request = appengine.UpdateVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_version), "__call__") as call: @@ -1439,7 +1443,7 @@ def test_update_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1453,7 +1457,7 @@ async def test_update_version_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.UpdateVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_version), "__call__") as call: @@ -1471,7 +1475,7 @@ async def test_update_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1567,7 +1571,7 @@ def test_delete_version_field_headers(): # a field header. Set these to a non-empty value. request = appengine.DeleteVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_version), "__call__") as call: @@ -1583,7 +1587,7 @@ def test_delete_version_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1597,7 +1601,7 @@ async def test_delete_version_field_headers_async(): # a field header. Set these to a non-empty value. request = appengine.DeleteVersionRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_version), "__call__") as call: @@ -1615,7 +1619,7 @@ async def test_delete_version_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"]